linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kautuk Consul <consul.kautuk@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Hugh Dickins <hughd@google.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] mmap.c: find_vma: remove if(mm) check
Date: Wed, 28 Mar 2012 09:13:00 +0530	[thread overview]
Message-ID: <CAFPAmTR67R6aF9U7-idXGDsbfvhTxEn=D3pu_Jjhq37rhcez8Q@mail.gmail.com> (raw)
In-Reply-To: <20120327151238.302a5920.akpm@linux-foundation.org>

On Wed, Mar 28, 2012 at 3:42 AM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Mon, 26 Mar 2012 19:49:27 -0400
> Kautuk Consul <consul.kautuk@gmail.com> wrote:
>
>> find_vma is called from kernel code where it is absolutely
>> sure that the mm_struct arg being passed to it is non-NULL.
>>
>> Remove the if(mm) check.
>
> It's odd that the if(mm) test exists - I wonder why it was originally
> added.  My repo only goes back ten years, and it's there in 2.4.18.
>
> Any code which calls find_vma() without an mm is surely pretty busted?
>
>
> Still, I think I'd prefer to do
>
>        if (WARN_ON_ONCE(!mm))
>                return NULL;
>

yes, I agree. that is safe for now as there are a huge number of calls
to this API.

> then let that bake for a kernel release, just to find out if we have a
> weird caller out there, such as a function which is called by both user
> threads and by kernel threads.

ok. I'll spin another one and send it to you with your suggestions in a day or
two when I go back home after my day job.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2012-03-28  3:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-26 23:49 Kautuk Consul
2012-03-27 22:12 ` Andrew Morton
2012-03-28  3:43   ` Kautuk Consul [this message]

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='CAFPAmTR67R6aF9U7-idXGDsbfvhTxEn=D3pu_Jjhq37rhcez8Q@mail.gmail.com' \
    --to=consul.kautuk@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=viro@zeniv.linux.org.uk \
    /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