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:	Fri, 1 Jun 2012 09:41:51 +0300
From:	Pekka Enberg <penberg@...nel.org>
To:	David Rientjes <rientjes@...gle.com>
Cc:	Andi Kleen <andi@...stfloor.org>, linux-kernel@...r.kernel.org,
	Andi Kleen <ak@...ux.intel.com>, cl@...ux.com
Subject: Re: [PATCH] slab/mempolicy: always use local policy from interrupt
 context v3

On Thu, May 31, 2012 at 11:45 PM, David Rientjes <rientjes@...gle.com> wrote:
> On Wed, 30 May 2012, Andi Kleen wrote:
>
>> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
>> index cfb6c86..b65eb06 100644
>> --- a/mm/mempolicy.c
>> +++ b/mm/mempolicy.c
>> @@ -1586,9 +1586,11 @@ static unsigned interleave_nodes(struct mempolicy *policy)
>>   * task can change it's policy.  The system default policy requires no
>>   * such protection.
>>   */
>> -unsigned slab_node(struct mempolicy *policy)
>> +unsigned slab_node(void)
>>  {
>> -     if (!policy || policy->flags & MPOL_F_LOCAL)
>> +     struct mempolicy *policy = current->mempolicy;
>> +
>> +     if (in_interrupt() || !policy || policy->flags & MPOL_F_LOCAL)
>>               return numa_node_id();
>>
>>       switch (policy->mode) {
>
> I think the version proposed by David Mackey is more clear, it makes it
> obvious that we don't want to dereference current in interrupt context
> whereas that relies on short-circuiting your conditional in your approach.

I like it better also. Christoph, Andi?
--
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