mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Wilson <wilsons@start.ca>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Hugh Dickins <hughd@google.com>,
	bookjovi@gmail.com, Andrew Morton <akpm@linux-foundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	David Rientjes <rientjes@google.com>,
	Stephen Wilson <wilsons@start.ca>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] proc: fix pagemap_read() error case (was Re: [PATCH] proc: put check_mem_permission before __get_free_page in mem_read)
Date: Tue, 26 Apr 2011 12:44:58 -0400	[thread overview]
Message-ID: <20110426164458.GB14478@fibrous.localdomain> (raw)
In-Reply-To: <20110426145226.F383.A69D9226@jp.fujitsu.com>

On Tue, Apr 26, 2011 at 02:50:16PM +0900, KOSAKI Motohiro wrote:
> I've finished audit other /proc allocation callsite. If my understand
> is correct, only pagemap_read() has the same issue.

I think there is one additional location that might be worth looking at.
We have a kmalloc(struct numa_maps) happening in show_numa_map() (see
mempolicy.c).  In this case there is an allocation/free cycle happening
for each vma as we generate the seq_file.

Unfortunately a fix might require a little work.  Initial thinking
suggests that we perform a single allocation at numa_maps_open() time.
However, there is an odd layering/dependency issue between mempolicy.c
and task_mmu.c.  A "simple clean fix" does not seem obvious to me.

I am very tempted to suggest we move the proc related stuff out of
mempolicy.c.  However, see 1a75a6c8.

Thoughts?  I can certainly look into this some more if needed.

-- 
steve


  reply	other threads:[~2011-04-26 16:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-18  0:20 [PATCH] proc: put check_mem_permission before __get_free_page in mem_read bookjovi
2011-04-24 15:33 ` KOSAKI Motohiro
2011-04-25 14:31 ` Stephen Wilson
2011-04-26  3:56 ` Hugh Dickins
2011-04-26  5:12   ` KOSAKI Motohiro
2011-04-26  5:50     ` [PATCH] proc: fix pagemap_read() error case (was Re: [PATCH] proc: put check_mem_permission before __get_free_page in mem_read) KOSAKI Motohiro
2011-04-26 16:44       ` Stephen Wilson [this message]
2011-04-26 20:44       ` Hugh Dickins
2011-04-28  1:45         ` KOSAKI Motohiro
2011-04-26 16:03     ` [PATCH] proc: put check_mem_permission before __get_free_page in mem_read Stephen Wilson
2011-04-26 20:19     ` Hugh Dickins
2011-04-26  8:55   ` Jovi Zhang

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=20110426164458.GB14478@fibrous.localdomain \
    --to=wilsons@start.ca \
    --cc=akpm@linux-foundation.org \
    --cc=bookjovi@gmail.com \
    --cc=hughd@google.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rientjes@google.com \
    --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

all inboxes | Powered by JetHome®