linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "S, Venkatraman" <svenkatr@ti.com>
To: mani <manishrma@gmail.com>
Cc: Dave Chinner <david@fromorbit.com>,
	linux-mmc@vger.kernel.org, cjb@laptop.org, linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org, arnd.bergmann@linaro.org,
	alex.lemberg@sandisk.com, ilan.smith@sandisk.com,
	lporzio@micron.com, rmk+kernel@arm.linux.org.uk
Subject: Re: [PATCH v2 01/16] FS: Added demand paging markers to filesystem
Date: Tue, 8 May 2012 22:05:32 +0530	[thread overview]
Message-ID: <CANfBPZ9dzzamHe=O+Zi0w+Romk8WPerp6qF+3KsRvv+U_ZBFYA@mail.gmail.com> (raw)
In-Reply-To: <CAB+TZU8FNWuHrf6Hqnjs5fwH8yMJgd=CLPB0iUkrs2a-fgehtQ@mail.gmail.com>

On Tue, May 8, 2012 at 11:58 AM, mani <manishrma@gmail.com> wrote:
> How about adding the AS_DMPG flag in the file -> address_space when getting
> a filemap_fault()
> so that we can treat the page fault pages as the high priority pages over
> normal read requests.
> How about changing below lines for the support of the pages those are
> requested for the page fault ?
>
>
> --- a/fs/mpage.c 2012-05-04 12:59:12.000000000 +0530
> +++ b/fs/mpage.c 2012-05-07 13:13:49.000000000 +0530
> @@ -408,6 +408,8 @@ mpage_readpages(struct address_space *ma
>                     &last_block_in_bio, &map_bh,
>                     &first_logical_block,
>                     get_block);
> +           if(test_bit(AS_DMPG, &mapping->flags) && bio)
>
> +                 bio->bi_rw |= REQ_RW_DMPG
>         }
>         page_cache_release(page);
>     }
> --- a/include/linux/pagemap.h    2012-05-04 12:57:35.000000000 +0530
> +++ b/include/linux/pagemap.h    2012-05-07 13:15:24.000000000 +0530
> @@ -27,6 +27,7 @@ enum mapping_flags {
>  #if defined (CONFIG_BD_CACHE_ENABLED)
>     AS_DIRECT  =   __GFP_BITS_SHIFT + 4,  /* DIRECT_IO specified on file op
> */
>  #endif
> +   AS_DMPG  =   __GFP_BITS_SHIFT + 5,  /* DEMAND PAGE specified on file op
> */
>  };
>
>  static inline void mapping_set_error(struct address_space *mapping, int
> error)
>
> --- a/mm/filemap.c   2012-05-04 12:58:49.000000000 +0530
> +++ b/mm/filemap.c   2012-05-07 13:15:03.000000000 +0530
> @@ -1646,6 +1646,7 @@ int filemap_fault(struct vm_area_struct
>     if (offset >= size)
>         return VM_FAULT_SIGBUS;
>
> +   set_bit(AS_DMPG, &file->f_mapping->flags);
>     /*
>      * Do we have something in the page cache already?
>      */
>
> Will these changes have any adverse effect ?
>

Thanks for the example but I can't judge which of the two is the most
elegant or acceptable to maintainers.
I can test with your change and inform if it works.

> Thanks & Regards
> Manish
>
> On Mon, May 7, 2012 at 5:01 AM, Dave Chinner <david@fromorbit.com> wrote:
>>
>> On Thu, May 03, 2012 at 07:53:00PM +0530, Venkatraman S wrote:
>> > From: Ilan Smith <ilan.smith@sandisk.com>
>> >
>> > Add attribute to identify demand paging requests.
>> > Mark readpages with demand paging attribute.
>> >
>> > Signed-off-by: Ilan Smith <ilan.smith@sandisk.com>
>> > Signed-off-by: Alex Lemberg <alex.lemberg@sandisk.com>
>> > Signed-off-by: Venkatraman S <svenkatr@ti.com>
>> > ---
>> >  fs/mpage.c                |    2 ++
>> >  include/linux/bio.h       |    7 +++++++
>> >  include/linux/blk_types.h |    2 ++
>> >  3 files changed, 11 insertions(+)
>> >
>> > diff --git a/fs/mpage.c b/fs/mpage.c
>> > index 0face1c..8b144f5 100644
>> > --- a/fs/mpage.c
>> > +++ b/fs/mpage.c
>> > @@ -386,6 +386,8 @@ mpage_readpages(struct address_space *mapping,
>> > struct list_head *pages,
>> >                                       &last_block_in_bio, &map_bh,
>> >                                       &first_logical_block,
>> >                                       get_block);
>> > +                     if (bio)
>> > +                             bio->bi_rw |= REQ_RW_DMPG;
>>
>> Have you thought about the potential for DOSing a machine
>> with this? That is, user data reads can now preempt writes of any
>> kind, effectively stalling writeback and memory reclaim which will
>> lead to OOM situations. Or, alternatively, journal flushing will get
>> stalled and no new modifications can take place until the read
>> stream stops.
>>
>> This really seems like functionality that belongs in an IO
>> scheduler so that write starvation can be avoided, not in high-level
>> data read paths where we have no clue about anything else going on
>> in the IO subsystem....
>>
>> Cheers,
>>
>> Dave.
>> --
>> Dave Chinner
>> david@fromorbit.com
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-05-08 16:35 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-03 14:22 [PATCHv2 00/16] [FS, MM, block, MMC]: eMMC High Priority Interrupt Feature Venkatraman S
2012-05-03 14:23 ` [PATCH v2 01/16] FS: Added demand paging markers to filesystem Venkatraman S
2012-05-06 23:31   ` Dave Chinner
2012-05-07 16:46     ` S, Venkatraman
2012-05-09  0:33       ` Dave Chinner
2012-05-09 13:59         ` Arnd Bergmann
2012-05-09 15:03           ` Christoph Hellwig
2012-05-09 16:54             ` Arnd Bergmann
2012-05-09 15:27       ` Vivek Goyal
2012-05-08  6:28     ` mani
2012-05-08 16:35       ` S, Venkatraman [this message]
2012-05-03 14:23 ` [PATCH v2 02/16] MM: Added page swapping markers to memory management Venkatraman S
2012-05-03 14:23 ` [PATCH v2 03/16] block: add queue attributes to manage dpmg and swapin requests Venkatraman S
2012-05-03 14:23 ` [PATCH v2 04/16] block: add sysfs attributes for runtime control of dpmg and swapin Venkatraman S
2012-05-03 14:23 ` [PATCH v2 05/16] block: Documentation: add sysfs ABI for expedite_dmpg and expedite_swapin Venkatraman S
2012-05-03 14:23 ` [PATCH v2 06/16] block: treat DMPG and SWAPIN requests as special Venkatraman S
2012-05-03 14:38   ` Jeff Moyer
2012-05-03 16:22     ` S, Venkatraman
2012-05-03 14:23 ` [PATCH v2 07/16] mmc: core: helper function for finding preemptible command Venkatraman S
2012-05-03 14:23 ` [PATCH v2 08/16] mmc: core: add preemptibility tracking fields to mmc command Venkatraman S
2012-05-03 14:23 ` [PATCH v2 09/16] mmc: core: Add MMC abort interface Venkatraman S
2012-05-03 14:23 ` [PATCH v2 10/16] mmc: block: Detect HPI support in card and host controller Venkatraman S
2012-05-03 14:23 ` [PATCH v2 11/16] mmc: core: Implement foreground request preemption procedure Venkatraman S
2012-05-03 14:23 ` [PATCH v2 12/16] mmc: sysfs: Add sysfs entry for tuning preempt_time_threshold Venkatraman S
2012-05-03 14:23 ` [PATCH v2 13/16] mmc: Documentation: Add sysfs ABI for hpi_time_threshold Venkatraman S
2012-05-03 14:23 ` [PATCH v2 14/16] mmc: block: Implement HPI invocation and handling logic Venkatraman S
2012-05-09  8:35   ` kdorfman
2012-05-09 14:01     ` Arnd Bergmann
2012-05-09 14:06     ` S, Venkatraman
2012-05-03 14:23 ` [PATCH v2 15/16] mmc: Update preempted request with CORRECTLY_PRG_SECTORS_NUM info Venkatraman S
2012-05-03 14:23 ` [PATCH v2 16/16] mmc: omap_hsmmc: Implement abort_req host_ops Venkatraman S
2012-05-08  7:46 ` [PATCHv2 00/16] [FS, MM, block, MMC]: eMMC High Priority Interrupt Feature Minchan Kim
2012-05-08 16:31   ` S, Venkatraman
2012-05-09  0:45     ` Minchan Kim
2012-05-11 19:18       ` S, Venkatraman
2012-05-14  7:43       ` mani
2012-05-14  7:53         ` mani
2012-05-14  7:55         ` Minchan Kim

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='CANfBPZ9dzzamHe=O+Zi0w+Romk8WPerp6qF+3KsRvv+U_ZBFYA@mail.gmail.com' \
    --to=svenkatr@ti.com \
    --cc=alex.lemberg@sandisk.com \
    --cc=arnd.bergmann@linaro.org \
    --cc=cjb@laptop.org \
    --cc=david@fromorbit.com \
    --cc=ilan.smith@sandisk.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=lporzio@micron.com \
    --cc=manishrma@gmail.com \
    --cc=rmk+kernel@arm.linux.org.uk \
    /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