linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Bob Liu <lliubbo@gmail.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, hch@lst.de, hughd@google.com,
	npiggin@kernel.dk
Subject: Re: [PATCH] shmem: put inode if alloc_file failed
Date: Fri, 11 Mar 2011 18:20:36 +0800	[thread overview]
Message-ID: <AANLkTinv7sdCHkj+wenyML0S7pOq3+UjA06HYbZLxACT@mail.gmail.com> (raw)
In-Reply-To: <20110310000324.GC22723@ZenIV.linux.org.uk>

On Thu, Mar 10, 2011 at 8:03 AM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Wed, Mar 09, 2011 at 02:58:59PM -0800, Andrew Morton wrote:
>
>> > +put_inode:
>> > +   iput(inode);
>> >  put_dentry:
>> >     path_put(&path);
>> >  put_memory:
>>
>> Is this correct?  We've linked the inode to the dentry with
>> d_instantiate(), so the d_put() will do the iput() on the inode.
>
>
> ITYM path_put() and yes, it will.  There's no leak.
>

In my opinion, on no-mmu arch iput() will call generate_delete_inode()
> truncate_page_range() which just delete the page from pagecache.

But pages allocated by ramfs_nommu_expand_for_mapping() have
page->_count = 2 (one by alloc_pages + one by pagecache).
The page->_count is still 1 after iput(), so the memory can't be freed.

Is there something I am wrong?

Thanks.

-- 
Regards,
--Bob

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

      parent reply	other threads:[~2011-03-11 10:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-08  9:14 [PATCH] shmem: put inode if alloc_file failed Bob Liu
2011-03-08  9:15 ` [PATCH] shmem: using goto to replace several return Bob Liu
2011-03-09 23:01   ` Andrew Morton
2011-03-09 22:58 ` [PATCH] shmem: put inode if alloc_file failed Andrew Morton
2011-03-10  0:03   ` Al Viro
2011-03-11 10:12     ` Bob Liu
2011-03-11 10:20     ` Bob Liu [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=AANLkTinv7sdCHkj+wenyML0S7pOq3+UjA06HYbZLxACT@mail.gmail.com \
    --to=lliubbo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@kernel.dk \
    --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;
as well as URLs for NNTP newsgroup(s).