linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nikita Danilov <danilov@gmail.com>
To: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Huang Shijie <shijie8@gmail.com>,
	akpm@linux-foundation.org, linux-mm@kvack.org
Subject: Re: [PATCH] rmap : tidy the code
Date: Mon, 28 Sep 2009 15:30:21 +0400	[thread overview]
Message-ID: <8acda98c0909280430w2700826cu55f9629bafab066f@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0909281131460.14446@sister.anvils>

2009/9/28 Hugh Dickins <hugh.dickins@tiscali.co.uk>:
> On Mon, 28 Sep 2009, Huang Shijie wrote:
>
>> Introduce is_page_mapped_in_vma() to merge the vma_address() and
>> page_check_address().
>>
>> Make the rmap codes more simple.
>
> There is indeed a recurring pattern there; but personally, I prefer
> that recurring pattern, to introducing another multi-argument layer.
>
> I think it would make more sense to do the vma_address() inside (a
> differently named) page_check_address(); but that would still have
> to return the address, so I'll probably prefer what we have now.
>
> (And that seems to have been Nikita's preference when he introduced
> page_check_address(), to keep the vma_address() part of it separate.)
>

Indeed, I tried to minimize the number of parameters and to avoid
making "address" an output parameter. But on the other hand, there
were only 2 page_check_address() call-sites back then. Now there are 5
of them, so adding a parameter is more justifiable.

> Other opinions?

I agree that adding EFAULT check into page_check_address() is better.
The only call-site that does not call vma_address() before
page_check_address() is __xip_unmap() and it explicitly BUG_ON()s on
the same condition.

>
> Hugh
>

Nikita.

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

  reply	other threads:[~2009-09-28 15:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-28  9:03 [PATCH] rmap : tidy the code Huang Shijie
2009-09-28 10:44 ` Hugh Dickins
2009-09-28 11:30   ` Nikita Danilov [this message]
2009-09-29  2:06     ` Huang Shijie
2009-09-29 10:28       ` Hugh Dickins

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=8acda98c0909280430w2700826cu55f9629bafab066f@mail.gmail.com \
    --to=danilov@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hugh.dickins@tiscali.co.uk \
    --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;
as well as URLs for NNTP newsgroup(s).