From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755669AbbFONkU (ORCPT ); Mon, 15 Jun 2015 09:40:20 -0400 Received: from mail.skyhub.de ([78.46.96.112]:44808 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755221AbbFONkP (ORCPT ); Mon, 15 Jun 2015 09:40:15 -0400 Date: Mon, 15 Jun 2015 15:40:08 +0200 From: Borislav Petkov To: Peter Zijlstra Cc: Sergey Senozhatsky , Andrew Morton , Tejun Heo , "David S. Miller" , Amir Vadai , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCH resend] cpumask: don't perform while loop in cpumask_next_and() Message-ID: <20150615134008.GA4447@pd.tnic> References: <1425223323-20180-1-git-send-email-sergey.senozhatsky@gmail.com> <20150615131221.GA12596@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150615131221.GA12596@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 15, 2015 at 03:12:21PM +0200, Peter Zijlstra wrote: > On Mon, Mar 02, 2015 at 12:22:03AM +0900, Sergey Senozhatsky wrote: > > > +++ b/lib/cpumask.c > > @@ -37,10 +37,11 @@ EXPORT_SYMBOL(__next_cpu_nr); > > int cpumask_next_and(int n, const struct cpumask *src1p, > > const struct cpumask *src2p) > > { > > + struct cpumask tmp; > > + > > + if (cpumask_and(&tmp, src1p, src2p)) > > + return cpumask_next(n, &tmp); > > + return nr_cpu_ids; > > } > > EXPORT_SYMBOL(cpumask_next_and); > > Just ran into this; I though we were not supposed to put cpumasks on the > stack because $BIG. ?! > > explain. That's some fat stack with 8K CPUs: cpumask_next_and: pushq %rbp # movq %rsp, %rbp #, pushq %rbx # movl %edi, %ebx # n, n leaq -1040(%rbp), %rdi #, tmp106 subq $1032, %rsp #, ^^^^^ Lovely. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --