mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Li Yang <leoli@freescale.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, gregkh@suse.de
Subject: Re: [RFC] char/mem: Honor O_SYNC over intelligent setting of uncached  access
Date: Wed, 18 Nov 2009 19:22:22 +0800	[thread overview]
Message-ID: <2a27d3730911180322i5a0dce3ds7deee6e96c6733b9@mail.gmail.com> (raw)
In-Reply-To: <873a4c5d4y.fsf@basil.nowhere.org>

On Wed, Nov 18, 2009 at 6:41 PM, Andi Kleen <andi@firstfloor.org> wrote:
> Li Yang <leoli@freescale.com> writes:
>
> D> The original code will automatially set the page non-cacheable if the mmap'ped
>> address is not in kernel managed low memory.
>>
>> We already have O_SYNC flag to pass the cacheability settings.   Therefore we should
>> honor the case that O_SYNC is delibrately not used.  For example, it is useful to the
>> case that not all system memory is managed by Linux, and want to be mmaped cacheable.
>>
>> Not sure if there is anything out there depending on the previous behavior.
>
> Very likely there is. That change seems rather dangerous.
>
> If you wanted to do something like this you would need a long
> deprecation period with printks and format warnings. But most likely
> it's not worth it, what advantage does the change have?

The general advantage is that user has the true control of the page
cacheability through O_SYNC file open() flag.  For the previous way,
kernel might map memory as non-cacheable when it's not necessary.  One
most common use case is that, user could limit the memory managed by
kernel and mmap the memory manually.  But he can't make that VMA
cacheable.  The user should have a better idea than kernel if a
certain memory space is I/O or not when using mmap().

- Leo

      reply	other threads:[~2009-11-18 11:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18  8:05 Li Yang
2009-11-18 10:41 ` Andi Kleen
2009-11-18 11:22   ` Li Yang [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=2a27d3730911180322i5a0dce3ds7deee6e96c6733b9@mail.gmail.com \
    --to=leoli@freescale.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®