xfs
[Top] [All Lists]

Re: [PATCH 2/2] xfstests: generic/273: do not use /proc/cpuinfo

To: xfs@xxxxxxxxxxx
Subject: Re: [PATCH 2/2] xfstests: generic/273: do not use /proc/cpuinfo
From: Carlos Maiolino <cmaiolino@xxxxxxxxxx>
Date: Wed, 23 Oct 2013 11:09:30 -0200
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1382529524-2184-3-git-send-email-stanislav.kholmanskikh@xxxxxxxxxx>
Mail-followup-to: xfs@xxxxxxxxxxx
References: <1382529524-2184-1-git-send-email-stanislav.kholmanskikh@xxxxxxxxxx> <1382529524-2184-3-git-send-email-stanislav.kholmanskikh@xxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
Looks good indeed.

Reviewed-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx>
On Wed, Oct 23, 2013 at 03:58:44PM +0400, Stanislav Kholmanskikh wrote:
> The content of /proc/cpuinfo file is platform-dependent.
> So we can not use it reliably to check a number of available cpus.
> It would be better to use sysfs interface, as _no_of_online_cpus() does.
> 
> Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@xxxxxxxxxx>
> ---
>  tests/generic/273 |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/tests/generic/273 b/tests/generic/273
> index d149808..c028438 100755
> --- a/tests/generic/273
> +++ b/tests/generic/273
> @@ -47,7 +47,7 @@ count=2
>  
>  _threads_set()
>  {
> -     _cpu_num=`cat /proc/cpuinfo | grep "processor" | wc -l`
> +     _cpu_num=`_no_of_online_cpus`
>       threads=$(($_cpu_num * 50))
>       if [ $threads -gt 200 ]
>       then
> -- 
> 1.7.1
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

-- 
Carlos

<Prev in Thread] Current Thread [Next in Thread>