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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4976176B.2090907@sgi.com>
Date:	Tue, 20 Jan 2009 10:26:51 -0800
From:	Mike Travis <travis@....com>
To:	Rusty Russell <rusty@...tcorp.com.au>
CC:	Ben Hutchings <bhutchings@...arflare.com>,
	Ingo Molnar <mingo@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>, Jack Steiner <steiner@....com>,
	linux-kernel@...r.kernel.org, linux-net-drivers@...arflare.com
Subject: Re: [PATCH 4/5] cpumask: convert drivers/net/sfc [PATCH supplied]

Rusty Russell wrote:
> On Tuesday 20 January 2009 03:38:30 Ben Hutchings wrote:
>> On Wed, 2009-01-07 at 11:58 -0800, Mike Travis wrote:
>>> From: Rusty Russell <rusty@...tcorp.com.au>
>>>
>>> Impact: reduce stack usage, use new cpumask API.
>>>
>>> Remove a cpumask from the stack.  Ben Hutchings indicated that printing
>>> a warning and returning 1 was acceptable for the corner case where allocation
>>> fails.
>>>
>>> Signed-off-by: Rusty Russell <rusty@...tcorp.com.au>
>>> Signed-off-by: Mike Travis <travis@....com>
>>> Cc: Ben Hutchings <bhutchings@...arflare.com>
>>> Cc: linux-net-drivers@...arflare.com
>> Acked-by: Ben Hutchings <bhutchings@...arflare.com>
>>
>> This seems to work.
>>
>>> ---
>>>  drivers/net/sfc/efx.c |   15 +++++++++++----
>>>  1 file changed, 11 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
>>> --- a/drivers/net/sfc/efx.c
>>> +++ b/drivers/net/sfc/efx.c
>>> @@ -854,20 +854,27 @@ static void efx_fini_io(struct efx_nic *
>>>   * interrupts across them. */
>>>  static int efx_wanted_rx_queues(void)
>>>  {
>>> -	cpumask_t core_mask;
>>> +	cpumask_var_t core_mask;
>>>  	int count;
>>>  	int cpu;
>>>  
>>> -	cpus_clear(core_mask);
>>> +	if (!alloc_cpumask_var(&core_mask, GFP_KERNEL)) {
>>> +		printk(KERN_WARNING
>>> +		       "efx.c: allocation failure, irq balancing hobbled\n");
>> [...]
>>
>> This is an exceedingly unlikely error case so the error message is not
>> that important, but if you don't mind re-spinning this then please make
>> it "sfc: RSS disabled due to allocation failure\n".
> 
> OK, I'm away from all my machines, at linux.conf.au.  Mike, can you change
> this if you haven't already?
> 
> Thanks,
> Rusty.
> 

Subject: sfc: modify allocation error message

Impact: change error message when alloc_cpumask_var fails.

Signed-off-by: Mike Travis <travis@....com>
---
 drivers/net/sfc/efx.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6-for-ingo.orig/drivers/net/sfc/efx.c
+++ linux-2.6-for-ingo/drivers/net/sfc/efx.c
@@ -858,9 +858,9 @@ static int efx_wanted_rx_queues(void)
 	int count;
 	int cpu;
 
-	if (!alloc_cpumask_var(&core_mask, GFP_KERNEL)) {
+	if (unlikely(!alloc_cpumask_var(&core_mask, GFP_KERNEL))) {
 		printk(KERN_WARNING
-		       "efx.c: allocation failure, irq balancing hobbled\n");
+		       "sfc: RSS disabled due to allocation failure\n");
 		return 1;
 	}
 


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