linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Travis <travis@sgi.com>
To: David Miller <davem@davemloft.net>
Cc: nickpiggin@yahoo.com.au, mingo@elte.hu,
	akpm@linux-foundation.org, steiner@sgi.com, jes@sgi.com,
	tglx@linutronix.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] smp: reduce stack requirements for smp_call_function_mask
Date: Mon, 08 Sep 2008 13:11:59 -0700	[thread overview]
Message-ID: <48C5870F.6050509@sgi.com> (raw)
In-Reply-To: <20080908.125153.263452187.davem@davemloft.net>

David Miller wrote:
> From: Nick Piggin <nickpiggin@yahoo.com.au>
> Date: Mon, 8 Sep 2008 20:30:41 +1000
> 
>> Is that being tried? Setting it to 8192 or even higher during QA seems
>> like a good idea to me.
> 
> This is a great idea, especially since it will make it even more
> painfully obvious that essentially any function local cpumask_t
> variable is a bug.

Yes, that's what I have done in the past ... but putting it into the QA
testing would really trigger those stack overflow problems... ;-)

> 
> Really, it seems sensible to do something like:
> 
> 1) Make cpumask_t a pointer.
> 
> 2) Add cpumask_data_t which is what cpumask_t is now.  This gets
>    used when for the actual storage, and will only get applied to
>    datastructures that are dynamically allocated.  For example, for
>    the cpu_vm_mask in mm_struct.
> 
> 3) Type make and fix build failures until they are all gone.

I was wondering if we'd need to be able to default a cpumask_t pointer
argument to be a const and then use a different method for those cases
where it shouldn't be?  This would strengthen the compiler type checking
of functions calls.

For example:

	proto(cpumask_t mask)

would imply that *mask is a const, whereas

	proto(cpumask_var mask)

would indicate it to be non-const?

But then we couldn't use "cpumask_t" as a local declarator... So perhaps
we need something completely different for declaring cpumask arguments?

(I'm trying to figure out how to structure this with the least amount of
source editing.)

Thanks!
Mike



  reply	other threads:[~2008-09-08 20:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-05 21:40 [PATCH 0/3] smp: reduce stack requirements for smp_call_function_mask Mike Travis
2008-09-05 21:40 ` [PATCH 1/3] " Mike Travis
2008-09-05 21:40 ` [PATCH 2/3] x86: reduce stack requirements for send_call_func_ipi Mike Travis
2008-09-05 21:40 ` [PATCH 3/3] x86: restore 4096 limit for NR_CPUS Mike Travis
2008-09-06 13:29 ` [PATCH 0/3] smp: reduce stack requirements for smp_call_function_mask Ingo Molnar
2008-09-06 18:12   ` Mike Travis
2008-09-06 18:21     ` Ingo Molnar
2008-09-08 10:30     ` Nick Piggin
2008-09-08 15:47       ` Mike Travis
2008-09-08 19:51       ` David Miller
2008-09-08 20:11         ` Mike Travis [this message]
2008-09-08 20:48           ` David Miller
2008-09-08  9:48   ` Jes Sorensen
2008-09-08 15:41     ` Mike Travis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48C5870F.6050509@sgi.com \
    --to=travis@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=jes@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=steiner@sgi.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).