All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zumeng Chen <zumeng.chen@windriver.com>
To: Bruce Ashfield <bruce.ashfield@windriver.com>
Cc: yocto@yoctoproject.org
Subject: Re: [PATCH] mm/msync: tweak tmpfs patch for syscall msync
Date: Thu, 26 Apr 2012 08:59:37 +0800	[thread overview]
Message-ID: <4F989DF9.1070308@windriver.com> (raw)
In-Reply-To: <4F980070.2070303@windriver.com>

That was my last version, you can google to get by "msync zumeng"
So feel free to merge it.

Regards,
Zumeng
于 2012年04月25日 21:47, Bruce Ashfield 写道:
> On 12-04-25 06:06 AM, Kang Kai wrote:
>> Commit 1c3ae5441 fixes MIPS CPU cache alias problem. But it makes
>
> Put a short log after the commit ID, that way we can read what the
> old commit was trying to do right in this commit.
>
>> posix test cases mlockall/3-6 3-7 fail.
>
> Can we expand on what the test is doing ? That way the commit
> header is stand alone. I know that I haven't memorized what all the
> posix tests do :)
>
>> Tweak the patch to:
>> 1 check the vma and its flags first
>
> Can you expand here as well. Do you really mean that you've moved
> the CONFIG_TMPFS block down in the function so that the normal
> vma flag checking will occur ?
>
>> 2 don't quit the function when meet first vma belongs to tmpfs file
>
> And for this part, can you (or Zumeng) explain why we used to need
> to exit immediately and now we don't ?
>
> The patch looks good though, thanks for looking into this tricky
> area of code.
>
> Cheers,
>
> Bruce
>
>>
>> Signed-off-by: Kang Kai<kai.kang@windriver.com>
>> ---
>> mm/msync.c | 30 +++++++++++++-----------------
>> 1 files changed, 13 insertions(+), 17 deletions(-)
>>
>> diff --git a/mm/msync.c b/mm/msync.c
>> index ced6215..31cd311 100644
>> --- a/mm/msync.c
>> +++ b/mm/msync.c
>> @@ -60,23 +60,6 @@ SYSCALL_DEFINE3(msync, unsigned long, start, 
>> size_t, len, int, flags)
>> down_read(&mm->mmap_sem);
>> vma = find_vma(mm, start);
>>
>> -#ifdef CONFIG_TMPFS
>> - /*
>> - * For tmpfs, no matter which flag(ASYNC or SYNC) gets from msync,
>> - * there is not so much thing to do for CPUs without cache alias,
>> - * But for some CPUs with cache alias, msync has to flush cache
>> - * explicitly, which makes sure the data coherency between memory
>> - * file and cache.
>> - */
>> - file = vma->vm_file;
>> - if (file&& (file->f_op ==&shmem_file_operations)) {
>> - if(CPU_HAS_CACHE_ALIAS)
>> - flush_cache_range(vma, start, start+len);
>> - error = 0;
>> - goto out_unlock;
>> - }
>> -#endif
>> -
>> for (;;) {
>>
>> /* Still start< end. */
>> @@ -97,6 +80,19 @@ SYSCALL_DEFINE3(msync, unsigned long, start, 
>> size_t, len, int, flags)
>> goto out_unlock;
>> }
>> file = vma->vm_file;
>> +#ifdef CONFIG_TMPFS
>> + /*
>> + * For tmpfs, no matter which flag(ASYNC or SYNC) gets from msync,
>> + * there is not so much thing to do for CPUs without cache alias,
>> + * But for some CPUs with cache alias, msync has to flush cache
>> + * explicitly, which makes sure the data coherency between memory
>> + * file and cache.
>> + */
>> + if (file&& (file->f_op ==&shmem_file_operations)) {
>> + if(CPU_HAS_CACHE_ALIAS)
>> + flush_cache_range(vma, start, start+len);
>> + }
>> +#endif
>> start = vma->vm_end;
>> if ((flags& MS_SYNC)&& file&&
>> (vma->vm_flags& VM_SHARED)) {
>



  reply	other threads:[~2012-04-26  1:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25 10:06 [PATCH] mm/msync: tweak tmpfs patch for syscall msync Kang Kai
2012-04-25 13:47 ` Bruce Ashfield
2012-04-26  0:59   ` Zumeng Chen [this message]
2012-04-26  1:15     ` Bruce Ashfield
2012-04-26  1:16       ` Zumeng Chen
2012-04-26  2:00         ` Kang Kai

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=4F989DF9.1070308@windriver.com \
    --to=zumeng.chen@windriver.com \
    --cc=bruce.ashfield@windriver.com \
    --cc=yocto@yoctoproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.