lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 3 Apr 2008 11:56:16 -0700
From:	"Paul Menage" <menage@...gle.com>
To:	balbir@...ux.vnet.ibm.com
Cc:	"Dave Hansen" <dave@...ux.vnet.ibm.com>,
	"Pavel Emelianov" <xemul@...nvz.org>,
	"Hugh Dickins" <hugh@...itas.com>,
	"Sudhir Kumar" <skumar@...ux.vnet.ibm.com>,
	"YAMAMOTO Takashi" <yamamoto@...inux.co.jp>, lizf@...fujitsu.com,
	linux-kernel@...r.kernel.org, taka@...inux.co.jp,
	linux-mm@...ck.org, "David Rientjes" <rientjes@...gle.com>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	"KAMEZAWA Hiroyuki" <kamezawa.hiroyu@...fujitsu.com>
Subject: Re: [-mm] Add an owner to the mm_struct (v7)

On Thu, Apr 3, 2008 at 11:51 AM, Balbir Singh <balbir@...ux.vnet.ibm.com> wrote:
>  >> +     * delay_group_leader() ensures that if the group leader is around
>  >> +     * we need not select a new owner.
>  >> +     */
>  >> +    ret = (mm && (atomic_read(&mm->mm_users) > 1) && (mm->owner == p) &&
>  >> +            !delay_group_leader(p));
>  >> +    return ret;
>  >> +}
>  >
>  > Ugh.  Could you please spell this out a bit more.  I find that stuff
>  > above really hard to read.  Something like:
>  >
>  >       if (!mm)
>  >               return 0;
>  >       if (atomic_read(&mm->mm_users) <= 1)
>  >               return 0;
>  >       if (mm->owner != p)
>  >               return 0;
>  >       if (delay_group_leader(p))
>  >               return 0;
>  >       return 1;
>  >
>
>  The problem with code above is 4 branch instructions and the code I have just 4
>  AND operations.

They'll be completely equivalent to the compiler, due to the
short-circuit evaluation of &&

Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ