From: Hugh Dickins <hugh.dickins@tiscali.co.uk>
To: Huang Shijie <shijie8@gmail.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org
Subject: Re: [PATCH] shmem : remove redundant code
Date: Tue, 9 Mar 2010 21:25:12 +0000 (GMT) [thread overview]
Message-ID: <alpine.LSU.2.00.1003092123520.22884@sister.anvils> (raw)
In-Reply-To: <1268040782-28561-1-git-send-email-shijie8@gmail.com>
On Mon, 8 Mar 2010, Huang Shijie wrote:
> The prep_new_page() will call set_page_private(page, 0) to initiate
> the page.
>
> So the code is redundant.
>
> Signed-off-by: Huang Shijie <shijie8@gmail.com>
Acked-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
I didn't feel too enthusiastic at first, since private used not to be initialized
by page allocation, and I don't know of a strong reason why it should be: we do
strongly demand that page->mapping be NULL on allocation, but we leave page->index
with whatever it already contains, and I had thought page->_private the same.
But it seems we have been initializing private to 0 for nearly seven years now,
and it was done intentionally for something (XFS) to depend upon, so yes,
let's rely on that here too - thanks.
Hugh
> ---
> mm/shmem.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/mm/shmem.c b/mm/shmem.c
> index eef4ebe..dde4363 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -433,8 +433,6 @@ static swp_entry_t *shmem_swp_alloc(struct shmem_inode_info *info, unsigned long
>
> spin_unlock(&info->lock);
> page = shmem_dir_alloc(mapping_gfp_mask(inode->i_mapping));
> - if (page)
> - set_page_private(page, 0);
> spin_lock(&info->lock);
>
> if (!page) {
> --
> 1.6.6
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2010-03-09 21:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-08 9:33 Huang Shijie
2010-03-08 16:04 ` Minchan Kim
2010-03-09 2:02 ` Huang Shijie
2010-03-08 16:20 ` [PATCH] kvm : remove redundant initialization of page->private Minchan Kim
2010-03-10 10:19 ` Avi Kivity
2010-03-10 14:31 ` Minchan Kim
2010-03-11 7:42 ` Avi Kivity
2010-03-11 8:51 ` Jan Kiszka
2010-03-11 8:55 ` Avi Kivity
2010-03-11 18:43 ` Hugh Dickins
2010-03-09 21:25 ` Hugh Dickins [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=alpine.LSU.2.00.1003092123520.22884@sister.anvils \
--to=hugh.dickins@tiscali.co.uk \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=shijie8@gmail.com \
/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