Re: [PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-12-23 Thread Suren Baghdasaryan
On Tue, Dec 22, 2020 at 11:57 PM Christoph Hellwig wrote: > > On Tue, Dec 22, 2020 at 09:48:43AM -0800, Suren Baghdasaryan wrote: > > Thanks for the feedback! The use case is userspace memory reaping > > similar to oom-reaper. Detailed justification is here: > > https://lore.kernel.org/linux-mm/20

Re: [PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-12-22 Thread Christoph Hellwig
On Tue, Dec 22, 2020 at 09:48:43AM -0800, Suren Baghdasaryan wrote: > Thanks for the feedback! The use case is userspace memory reaping > similar to oom-reaper. Detailed justification is here: > https://lore.kernel.org/linux-mm/20201124053943.1684874-1-sur...@google.com Given that this new variant

Re: [PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-12-22 Thread Suren Baghdasaryan
On Tue, Dec 22, 2020 at 9:48 AM Suren Baghdasaryan wrote: > > On Tue, Dec 22, 2020 at 5:44 AM Christoph Hellwig wrote: > > > > On Fri, Dec 11, 2020 at 09:27:46PM +0100, Jann Horn wrote: > > > > Can we just use one element in iovec to indicate entire address rather > > > > than using up the reserv

Re: [PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-12-22 Thread Suren Baghdasaryan
On Tue, Dec 22, 2020 at 5:44 AM Christoph Hellwig wrote: > > On Fri, Dec 11, 2020 at 09:27:46PM +0100, Jann Horn wrote: > > > Can we just use one element in iovec to indicate entire address rather > > > than using up the reserved flags? > > > > > > struct iovec { > > > .iov

Re: [PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-12-22 Thread Christoph Hellwig
On Fri, Dec 11, 2020 at 09:27:46PM +0100, Jann Horn wrote: > > Can we just use one element in iovec to indicate entire address rather > > than using up the reserved flags? > > > > struct iovec { > > .iov_base = NULL, > > .iov_len = (~(size_t)0), > > }

Re: [PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-12-11 Thread Jann Horn
On Sat, Dec 12, 2020 at 12:01 AM Minchan Kim wrote: > On Fri, Dec 11, 2020 at 09:27:46PM +0100, Jann Horn wrote: > > +CC Christoph Hellwig for opinions on compat > > > > On Thu, Nov 26, 2020 at 12:22 AM Minchan Kim wrote: > > > On Mon, Nov 23, 2020 at 09:39:42PM -0800, Suren Baghdasaryan wrote: >

Re: [PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-12-11 Thread Minchan Kim
On Fri, Dec 11, 2020 at 09:27:46PM +0100, Jann Horn wrote: > +CC Christoph Hellwig for opinions on compat > > On Thu, Nov 26, 2020 at 12:22 AM Minchan Kim wrote: > > On Mon, Nov 23, 2020 at 09:39:42PM -0800, Suren Baghdasaryan wrote: > > > process_madvise requires a vector of address ranges to be

Re: [PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-12-11 Thread Jann Horn
+CC Christoph Hellwig for opinions on compat On Thu, Nov 26, 2020 at 12:22 AM Minchan Kim wrote: > On Mon, Nov 23, 2020 at 09:39:42PM -0800, Suren Baghdasaryan wrote: > > process_madvise requires a vector of address ranges to be provided for > > its operations. When an advice should be applied to

Re: [PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-12-07 Thread Suren Baghdasaryan
On Mon, Nov 30, 2020 at 11:01 AM Suren Baghdasaryan wrote: > > On Wed, Nov 25, 2020 at 3:43 PM Minchan Kim wrote: > > > > On Wed, Nov 25, 2020 at 03:23:40PM -0800, Suren Baghdasaryan wrote: > > > On Wed, Nov 25, 2020 at 3:13 PM Minchan Kim wrote: > > > > > > > > On Mon, Nov 23, 2020 at 09:39:42P

Re: [PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-11-30 Thread Suren Baghdasaryan
On Wed, Nov 25, 2020 at 3:43 PM Minchan Kim wrote: > > On Wed, Nov 25, 2020 at 03:23:40PM -0800, Suren Baghdasaryan wrote: > > On Wed, Nov 25, 2020 at 3:13 PM Minchan Kim wrote: > > > > > > On Mon, Nov 23, 2020 at 09:39:42PM -0800, Suren Baghdasaryan wrote: > > > > process_madvise requires a vect

Re: [PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-11-25 Thread Minchan Kim
On Wed, Nov 25, 2020 at 03:23:40PM -0800, Suren Baghdasaryan wrote: > On Wed, Nov 25, 2020 at 3:13 PM Minchan Kim wrote: > > > > On Mon, Nov 23, 2020 at 09:39:42PM -0800, Suren Baghdasaryan wrote: > > > process_madvise requires a vector of address ranges to be provided for > > > its operations. Wh

Re: [PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-11-25 Thread Suren Baghdasaryan
On Wed, Nov 25, 2020 at 3:13 PM Minchan Kim wrote: > > On Mon, Nov 23, 2020 at 09:39:42PM -0800, Suren Baghdasaryan wrote: > > process_madvise requires a vector of address ranges to be provided for > > its operations. When an advice should be applied to the entire process, > > the caller process h

Re: [PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-11-25 Thread Minchan Kim
On Mon, Nov 23, 2020 at 09:39:42PM -0800, Suren Baghdasaryan wrote: > process_madvise requires a vector of address ranges to be provided for > its operations. When an advice should be applied to the entire process, > the caller process has to obtain the list of VMAs of the target process > by readi

[PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-11-23 Thread Suren Baghdasaryan
process_madvise requires a vector of address ranges to be provided for its operations. When an advice should be applied to the entire process, the caller process has to obtain the list of VMAs of the target process by reading the /proc/pid/maps or some other way. The cost of this operation grows li