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]
Message-ID: <49CE8499.6080003@kernel.org>
Date:	Sat, 28 Mar 2009 13:12:09 -0700
From:	Yinghai Lu <yinghai@...nel.org>
To:	Rusty Russell <rusty@...tcorp.com.au>
CC:	Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Mike Travis <travis@....com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] irq: remove wrong ifdef

Rusty Russell wrote:
> On Saturday 28 March 2009 15:15:34 Yinghai Lu wrote:
>> Impact: fix smp_affinity copying
>>
>> CPUMASKS_OFFSTACK is not defined anywhere.
>> and init_allocate_desc_masks called before it set affinity to all cpus...
>>
>> just remove those #idef to make them get copied
>>
>> Signed-off-by: Yinghai Lu <yinghai@...nel.org>
>>
>> ---
>>  include/linux/irq.h |    4 ----
>>  1 file changed, 4 deletions(-)
>>
>> Index: linux-2.6/include/linux/irq.h
>> ===================================================================
>> --- linux-2.6.orig/include/linux/irq.h
>> +++ linux-2.6/include/linux/irq.h
>> @@ -468,20 +468,16 @@ static inline bool init_alloc_desc_masks
>>   * @new_desc:	pointer to new irq_desc struct
>>   *
>>   * Insures affinity and pending_masks are copied to new irq_desc.
>> - * If !CONFIG_CPUMASKS_OFFSTACK the cpumasks are embedded in the
>> - * irq_desc struct so the copy is redundant.
>>   */
>>  
>>  static inline void init_copy_desc_masks(struct irq_desc *old_desc,
>>  					struct irq_desc *new_desc)
>>  {
>> -#ifdef CONFIG_CPUMASKS_OFFSTACK
>>  	cpumask_copy(new_desc->affinity, old_desc->affinity);
>>  
>>  #ifdef CONFIG_GENERIC_PENDING_IRQ
>>  	cpumask_copy(new_desc->pending_mask, old_desc->pending_mask);
>>  #endif
>> -#endif
>>  }
>>  
>>  #else /* !CONFIG_SMP */
> 
> Wow, that is supposed to be CONFIG_CPUMASK_OFFSTACK.
> 
> The reason it is there is that we already do the memcpy of old_desc: this
> extra copy is only needed if the cpumasks are external.  But perhaps it's
> an over-optimization.

please check 
[PATCH] irq: correct CPUMASKS_OFFSTACK typo -v2

because init_alloc_desc_masks will set desc->affinity to all cpus even CPUMASK_OFFSET is not set.

-v2 will seperate that function to alloc_desc_masks and init_desc_masks. 

YH
--
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