linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-fbdev-devel@lists.sourceforge.net, adaplas@gmail.com,
	arnd@arndb.de, linux-mm@kvack.org, lethal@linux-sh.org,
	jayakumar.lkml@gmail.com
Subject: Re: [PATCH] video: arch specific page protection support for deferred io
Date: Thu, 25 Jun 2009 15:06:24 +0900	[thread overview]
Message-ID: <aec7e5c30906242306x64832a8dtfd78fa00ba751ca9@mail.gmail.com> (raw)
In-Reply-To: <20090624195647.9d0064c7.akpm@linux-foundation.org>

On Thu, Jun 25, 2009 at 11:56 AM, Andrew
Morton<akpm@linux-foundation.org> wrote:
> On Wed, 24 Jun 2009 19:54:13 +0900 Magnus Damm <magnus.damm@gmail.com> wrote:
>
>> From: Magnus Damm <damm@igel.co.jp>
>>
>> This patch adds arch specific page protection support to deferred io.
>>
>> Instead of overwriting the info->fbops->mmap pointer with the
>> deferred io specific mmap callback, modify fb_mmap() to include
>> a #ifdef wrapped call to fb_deferred_io_mmap().  The function
>> fb_deferred_io_mmap() is extended to call fb_pgprotect() in the
>> case of non-vmalloc() frame buffers.
>>
>> With this patch uncached deferred io can be used together with
>> the sh_mobile_lcdcfb driver. Without this patch arch specific
>> page protection code in fb_pgprotect() never gets invoked with
>> deferred io.
>>
>> Signed-off-by: Magnus Damm <damm@igel.co.jp>
>> ---
>>
>>  For proper runtime operation with uncached vmas make sure
>>  "[PATCH][RFC] mm: uncached vma support with writenotify"
>>  is applied. There are no merge order dependencies.
>
> So this is dependent upon a patch which is in your tree, which is in
> linux-next?

I tried to say that there were _no_ dependencies merge wise. =)

There are 3 levels of dependencies:
1: pgprot_noncached() patches from Arnd
2: mm: uncached vma support with writenotify
3: video: arch specfic page protection support for deferred io

2 depends on 1 to compile, but 3 (this one) is disconnected from 2 and
1. So this patch can be merged independently.

>
>>  drivers/video/fb_defio.c |   10 +++++++---
>>  drivers/video/fbmem.c    |    6 ++++++
>>  include/linux/fb.h       |    2 ++
>>  3 files changed, 15 insertions(+), 3 deletions(-)
>>
>> --- 0001/drivers/video/fb_defio.c
>> +++ work/drivers/video/fb_defio.c     2009-06-24 19:07:11.000000000 +0900
>> @@ -19,6 +19,7 @@
>>  #include <linux/interrupt.h>
>>  #include <linux/fb.h>
>>  #include <linux/list.h>
>> +#include <asm/fb.h>
>
> Microblaze doesn't have an asm/fb.h.

Right, but fbmem.c includes asm/fb.h as well (for fb_pgprotect()), so
framebuffer isn't supported on Microblaze. So I think this is a
separate issue.

>>  /* to support deferred IO */
>>  #include <linux/rmap.h>
>> @@ -141,11 +142,16 @@ static const struct address_space_operat
>>       .set_page_dirty = fb_deferred_io_set_page_dirty,
>>  };
>>
>> -static int fb_deferred_io_mmap(struct fb_info *info, struct vm_area_struct *vma)
>> +int fb_deferred_io_mmap(struct file *file, struct fb_info *info,
>> +                     struct vm_area_struct *vma, unsigned long off)
>>  {
>>       vma->vm_ops = &fb_deferred_io_vm_ops;
>>       vma->vm_flags |= ( VM_IO | VM_RESERVED | VM_DONTEXPAND );
>>       vma->vm_private_data = info;
>> +
>> +     if (!is_vmalloc_addr(info->screen_base))
>> +             fb_pgprotect(file, vma, off);
>
> Add a comment explaining what's going on here?

Good idea!

>> @@ -1325,6 +1325,12 @@ __releases(&info->lock)
>>       off = vma->vm_pgoff << PAGE_SHIFT;
>>       if (!fb)
>>               return -ENODEV;
>> +
>> +#ifdef CONFIG_FB_DEFERRED_IO
>> +     if (info->fbdefio)
>> +             return fb_deferred_io_mmap(file, info, vma, off);
>> +#endif
>
> We can remove the ifdefs here...
>
>> +extern int fb_deferred_io_mmap(struct file *file, struct fb_info *info,
>> +                            struct vm_area_struct *vma, unsigned long off);
>
> if we do
>
> #else   /* CONFIG_FB_DEFERRED_IO */
> static inline int fb_deferred_io_mmap(struct file *file, struct fb_info *info,
>                                struct vm_area_struct *vma, unsigned long off)
> {
>        return 0;
> }
> #endif  /* CONFIG_FB_DEFERRED_IO */
>
> here.

The code is fbmem.c is currently filled with #ifdefs today, want me
create inline versions for fb_deferred_io_open() and
fb_deferred_io_fsync() as well?

Thanks for your comments!

/ magnus

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

  parent reply	other threads:[~2009-06-25  6:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-24 10:54 Magnus Damm
2009-06-25  2:56 ` Andrew Morton
2009-06-25  3:09   ` Paul Mundt
2009-06-25  3:15     ` Andrew Morton
2009-06-25  6:06   ` Magnus Damm [this message]
2009-06-25  7:03     ` Andrew Morton
2009-06-25 17:38       ` Paul Mundt
2009-06-25 18:12         ` Andrew Morton
2009-06-25 18:36           ` Jaya Kumar
2009-06-25 18:50             ` Paul Mundt
2009-06-26  7:50           ` Magnus Damm
2009-06-26  5:37       ` Magnus Damm
2009-06-25 18:06     ` Jaya Kumar
2009-06-25 20:57       ` Arnd Bergmann

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=aec7e5c30906242306x64832a8dtfd78fa00ba751ca9@mail.gmail.com \
    --to=magnus.damm@gmail.com \
    --cc=adaplas@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=jayakumar.lkml@gmail.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --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