All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dhaval Giani <dgiani@mozilla.com>
To: John Stultz <john.stultz@linaro.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Minchan Kim <minchan@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Android Kernel Team <kernel-team@android.com>,
	Robert Love <rlove@google.com>, Mel Gorman <mel@csn.ul.ie>,
	Hugh Dickins <hughd@google.com>,
	Dave Hansen <dave@linux.vnet.ibm.com>,
	Rik van Riel <riel@redhat.com>,
	Dmitry Adamushko <dmitry.adamushko@gmail.com>,
	Dave Chinner <david@fromorbit.com>, Neil Brown <neilb@suse.de>,
	Andrea Righi <andrea@betterlinux.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	Mike Hommey <mh@glandium.org>, Taras Glek <tglek@mozilla.com>,
	Jan Kara <jack@suse.cz>,
	KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
	Michel Lespinasse <walken@google.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH 5/8] vrange: Add new vrange(2) system call
Date: Thu, 20 Jun 2013 17:05:21 -0400	[thread overview]
Message-ID: <51C36E91.2020509@mozilla.com> (raw)
In-Reply-To: <1371010971-15647-6-git-send-email-john.stultz@linaro.org>

On 2013-06-12 12:22 AM, John Stultz wrote:
> From: Minchan Kim <minchan@kernel.org>
>
> This patch adds new system call sys_vrange.
>
> NAME
> 	vrange - Mark or unmark range of memory as volatile
>
> SYNOPSIS
> 	int vrange(unsigned_long start, size_t length, int mode,
> 			 int *purged);
>
> DESCRIPTION
> 	Applications can use vrange(2) to advise the kernel how it should
> 	handle paging I/O in this VM area.  The idea is to help the kernel
> 	discard pages of vrange instead of reclaiming when memory pressure
> 	happens. It means kernel doesn't discard any pages of vrange if
> 	there is no memory pressure.
>
> 	mode:
> 	VRANGE_VOLATILE
> 		hint to kernel so VM can discard in vrange pages when
> 		memory pressure happens.
> 	VRANGE_NONVOLATILE
> 		hint to kernel so VM doesn't discard vrange pages
> 		any more.
>
> 	If user try to access purged memory without VRANGE_NOVOLATILE call,
> 	he can encounter SIGBUS if the page was discarded by kernel.

I wonder if it would be possible to provide additional information here, 
for example "purge range at a time" as opposed to "purge page at a 
time". There are some valid use cases for both approaches and it doesn't 
make sense to deny one use case.

Thanks!
Dhaval

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

WARNING: multiple messages have this Message-ID (diff)
From: Dhaval Giani <dgiani@mozilla.com>
To: John Stultz <john.stultz@linaro.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Minchan Kim <minchan@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Android Kernel Team <kernel-team@android.com>,
	Robert Love <rlove@google.com>, Mel Gorman <mel@csn.ul.ie>,
	Hugh Dickins <hughd@google.com>,
	Dave Hansen <dave@linux.vnet.ibm.com>,
	Rik van Riel <riel@redhat.com>,
	Dmitry Adamushko <dmitry.adamushko@gmail.com>,
	Dave Chinner <david@fromorbit.com>, Neil Brown <neilb@suse.de>,
	Andrea Righi <andrea@betterlinux.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	Mike Hommey <mh@glandium.org>, Taras Glek <tglek@mozilla.com>,
	Jan Kara <jack@suse.cz>,
	KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
	Michel Lespinasse <walken@google.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH 5/8] vrange: Add new vrange(2) system call
Date: Thu, 20 Jun 2013 17:05:21 -0400	[thread overview]
Message-ID: <51C36E91.2020509@mozilla.com> (raw)
In-Reply-To: <1371010971-15647-6-git-send-email-john.stultz@linaro.org>

On 2013-06-12 12:22 AM, John Stultz wrote:
> From: Minchan Kim <minchan@kernel.org>
>
> This patch adds new system call sys_vrange.
>
> NAME
> 	vrange - Mark or unmark range of memory as volatile
>
> SYNOPSIS
> 	int vrange(unsigned_long start, size_t length, int mode,
> 			 int *purged);
>
> DESCRIPTION
> 	Applications can use vrange(2) to advise the kernel how it should
> 	handle paging I/O in this VM area.  The idea is to help the kernel
> 	discard pages of vrange instead of reclaiming when memory pressure
> 	happens. It means kernel doesn't discard any pages of vrange if
> 	there is no memory pressure.
>
> 	mode:
> 	VRANGE_VOLATILE
> 		hint to kernel so VM can discard in vrange pages when
> 		memory pressure happens.
> 	VRANGE_NONVOLATILE
> 		hint to kernel so VM doesn't discard vrange pages
> 		any more.
>
> 	If user try to access purged memory without VRANGE_NOVOLATILE call,
> 	he can encounter SIGBUS if the page was discarded by kernel.

I wonder if it would be possible to provide additional information here, 
for example "purge range at a time" as opposed to "purge page at a 
time". There are some valid use cases for both approaches and it doesn't 
make sense to deny one use case.

Thanks!
Dhaval

  parent reply	other threads:[~2013-06-20 21:05 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-12  4:22 [PATCH 0/8] Volatile Ranges (v8?) John Stultz
2013-06-12  4:22 ` John Stultz
2013-06-12  4:22 ` [PATCH 1/8] vrange: Add basic data structure and functions John Stultz
2013-06-12  4:22   ` John Stultz
2013-06-12  4:22 ` [PATCH 2/8] vrange: Add vrange support for file address_spaces John Stultz
2013-06-12  4:22   ` John Stultz
2013-06-12  4:22 ` [PATCH 3/8] vrange: Add vrange support to mm_structs John Stultz
2013-06-12  4:22   ` John Stultz
2013-06-12  4:22 ` [PATCH 4/8] vrange: Clear volatility on new mmaps John Stultz
2013-06-12  4:22   ` John Stultz
2013-06-13  6:28   ` Minchan Kim
2013-06-13  6:28     ` Minchan Kim
2013-06-13 23:43     ` John Stultz
2013-06-13 23:43       ` John Stultz
2013-06-14  0:21       ` Minchan Kim
2013-06-14  0:21         ` Minchan Kim
2013-06-12  4:22 ` [PATCH 5/8] vrange: Add new vrange(2) system call John Stultz
2013-06-12  4:22   ` John Stultz
2013-06-12  6:48   ` NeilBrown
2013-06-12 18:47     ` John Stultz
2013-06-12 18:47       ` John Stultz
2013-06-20 21:05   ` Dhaval Giani [this message]
2013-06-20 21:05     ` Dhaval Giani
2013-06-12  4:22 ` [PATCH 6/8] vrange: Add GFP_NO_VRANGE allocation flag John Stultz
2013-06-12  4:22   ` John Stultz
2013-06-12  4:22 ` [PATCH 7/8] vrange: Add method to purge volatile ranges John Stultz
2013-06-12  4:22   ` John Stultz
2013-06-17  7:13   ` Minchan Kim
2013-06-17  7:13     ` Minchan Kim
2013-06-17  7:24     ` Minchan Kim
2013-06-17  7:24       ` Minchan Kim
2013-06-19  4:34   ` Minchan Kim
2013-06-19  4:34     ` Minchan Kim
2013-10-01 14:00     ` Krzysztof Kozlowski
2013-10-02  1:32       ` Minchan Kim
2013-06-12  4:22 ` [PATCH 8/8] vrange: Send SIGBUS when user try to access purged page John Stultz
2013-06-12  4:22   ` John Stultz
2013-06-19  4:36   ` Minchan Kim
2013-06-19  4:36     ` Minchan Kim
2013-06-17 16:24 ` [PATCH 0/8] Volatile Ranges (v8?) Dhaval Giani
2013-06-18  4:11   ` Minchan Kim
2013-06-18  4:11     ` Minchan Kim
2013-06-18 16:59     ` Dhaval Giani
2013-06-18 16:59       ` Dhaval Giani
2013-06-19  4:41       ` Minchan Kim
2013-06-19  4:41         ` Minchan Kim
2013-06-19 18:36         ` Dhaval Giani
2013-06-19 18:36           ` Dhaval Giani

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=51C36E91.2020509@mozilla.com \
    --to=dgiani@mozilla.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrea@betterlinux.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=dave@linux.vnet.ibm.com \
    --cc=david@fromorbit.com \
    --cc=dmitry.adamushko@gmail.com \
    --cc=hughd@google.com \
    --cc=jack@suse.cz \
    --cc=john.stultz@linaro.org \
    --cc=kernel-team@android.com \
    --cc=kosaki.motohiro@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=mh@glandium.org \
    --cc=minchan@kernel.org \
    --cc=neilb@suse.de \
    --cc=riel@redhat.com \
    --cc=rlove@google.com \
    --cc=tglek@mozilla.com \
    --cc=walken@google.com \
    /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.