linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Huang Shijie <shijie8@gmail.com>
To: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org
Subject: Re: [PATCH] remove unused line for mmap_region()
Date: Mon, 22 Jun 2009 11:50:43 +0800	[thread overview]
Message-ID: <4A3EFF93.4000100@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0906211917350.4583@sister.anvils>


> On Sun, 21 Jun 2009, Huang Shijie wrote:
>
>   
>> 	The variable pgoff is not used in the following codes.
>> 	So, just remove the line.
>>
>> Signed-off-by: Huang Shijie <shijie8@gmail.com>
>>     
>
> Hmm, hmm, well, I suppose a grudging Ack, though I'd happily be overruled.
>
> Of course you are right, so why am I so reluctant to acknowledge it?
>
> Because it's exceptional for addr and pgoff to be different after
> coming back from the file's ->mmap method, and if someone adds a
> use for pgoff lower down (there was, of course, a use for pgoff
> in vma_merge lower down, until Linus moved that higher in 2.6.29),
> it's a fair bet that they'll forget to restore the update you're
> removing, and a fair bet that nobody will notice that it's gone
> wrong for a while.
>
>   
I knew the file's ->mmap method can change addr and pgoff, but I think 
the comment of
DavidM is enough to remind the person who wants to use pgoff lower down 
that pgoff maybe
go wrong for a while.

But now, it (this line) looks like a big fly on 'Mona Lisa'. :)
> However, what would be likely to need pgoff lower down, other than
> another attempt at vma_merge?  And given how we're now working with
> the vma_merge higher up (before pgoff had a chance to be adjusted),
> I think we can conclude that anything needing to meddle with pgoff
> would be setting some vm_flags that prevent merging anyway.
>
>   
Could you tell some drivers which will meddle with pgoff?
If a driver changes pgoff,the work done by vma_merge higher up will be 
invalidated.
The process gets a wrong memory map.
> So I can just about bring myself to Ack your patch, but...
>
> Hugh
>
>   
>> ---
>>  mm/mmap.c |    1 -
>>  1 files changed, 0 insertions(+), 1 deletions(-)
>>
>> diff --git a/mm/mmap.c b/mm/mmap.c
>> index 34579b2..1dd6aaa 100644
>> --- a/mm/mmap.c
>> +++ b/mm/mmap.c
>> @@ -1210,7 +1210,6 @@ munmap_back:
>>  	 *         f_op->mmap method. -DaveM
>>  	 */
>>  	addr = vma->vm_start;
>> -	pgoff = vma->vm_pgoff;
>>  	vm_flags = vma->vm_flags;
>>  
>>  	if (vma_wants_writenotify(vma))
>> -- 
>> 1.6.0.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>

  reply	other threads:[~2009-06-22  3:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-21 14:43 Huang Shijie
2009-06-21 18:30 ` Hugh Dickins
2009-06-22  3:50   ` Huang Shijie [this message]
2009-06-23 11:14     ` Hugh Dickins
2009-06-24  3:16       ` Huang Shijie
2009-06-24  4:22         ` 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=4A3EFF93.4000100@gmail.com \
    --to=shijie8@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hugh.dickins@tiscali.co.uk \
    --cc=linux-mm@kvack.org \
    /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