Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-06-27 Thread Prakash Sangappa
On 6/20/17 4:35 PM, Prakash Sangappa wrote: On 6/16/17 6:15 AM, Andrea Arcangeli wrote: Adding a single if (ctx->feature & UFFD_FEATURE_SIGBUS) goto out, branch for this corner case to handle_userfault() isn't great and the hugetlbfs mount option is absolutely zero cost to the

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-06-27 Thread Prakash Sangappa
On 6/20/17 4:35 PM, Prakash Sangappa wrote: On 6/16/17 6:15 AM, Andrea Arcangeli wrote: Adding a single if (ctx->feature & UFFD_FEATURE_SIGBUS) goto out, branch for this corner case to handle_userfault() isn't great and the hugetlbfs mount option is absolutely zero cost to the

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-06-20 Thread Prakash Sangappa
On 6/16/17 6:15 AM, Andrea Arcangeli wrote: Hello Prakash, Thanks for you response. Comments inline. On Tue, May 09, 2017 at 01:59:34PM -0700, Prakash Sangappa wrote: On 5/9/17 1:58 AM, Christoph Hellwig wrote: On Mon, May 08, 2017 at 03:12:42PM -0700, prakash.sangappa wrote:

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-06-20 Thread Prakash Sangappa
On 6/16/17 6:15 AM, Andrea Arcangeli wrote: Hello Prakash, Thanks for you response. Comments inline. On Tue, May 09, 2017 at 01:59:34PM -0700, Prakash Sangappa wrote: On 5/9/17 1:58 AM, Christoph Hellwig wrote: On Mon, May 08, 2017 at 03:12:42PM -0700, prakash.sangappa wrote:

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-06-16 Thread Andrea Arcangeli
Hello Prakash, On Tue, May 09, 2017 at 01:59:34PM -0700, Prakash Sangappa wrote: > > > On 5/9/17 1:58 AM, Christoph Hellwig wrote: > > On Mon, May 08, 2017 at 03:12:42PM -0700, prakash.sangappa wrote: > >> Regarding #3 as a general feature, do we want to > >> consider this and the complexity

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-06-16 Thread Andrea Arcangeli
Hello Prakash, On Tue, May 09, 2017 at 01:59:34PM -0700, Prakash Sangappa wrote: > > > On 5/9/17 1:58 AM, Christoph Hellwig wrote: > > On Mon, May 08, 2017 at 03:12:42PM -0700, prakash.sangappa wrote: > >> Regarding #3 as a general feature, do we want to > >> consider this and the complexity

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-16 Thread Prakash Sangappa
On 5/9/17 1:59 PM, Prakash Sangappa wrote: On 5/9/17 1:58 AM, Christoph Hellwig wrote: On Mon, May 08, 2017 at 03:12:42PM -0700, prakash.sangappa wrote: Regarding #3 as a general feature, do we want to consider this and the complexity associated with the implementation? We have to. Given

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-16 Thread Prakash Sangappa
On 5/9/17 1:59 PM, Prakash Sangappa wrote: On 5/9/17 1:58 AM, Christoph Hellwig wrote: On Mon, May 08, 2017 at 03:12:42PM -0700, prakash.sangappa wrote: Regarding #3 as a general feature, do we want to consider this and the complexity associated with the implementation? We have to. Given

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-09 Thread Prakash Sangappa
On 5/9/17 1:58 AM, Christoph Hellwig wrote: On Mon, May 08, 2017 at 03:12:42PM -0700, prakash.sangappa wrote: Regarding #3 as a general feature, do we want to consider this and the complexity associated with the implementation? We have to. Given that no one has exclusive access to hugetlbfs

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-09 Thread Prakash Sangappa
On 5/9/17 1:58 AM, Christoph Hellwig wrote: On Mon, May 08, 2017 at 03:12:42PM -0700, prakash.sangappa wrote: Regarding #3 as a general feature, do we want to consider this and the complexity associated with the implementation? We have to. Given that no one has exclusive access to hugetlbfs

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-09 Thread Christoph Hellwig
On Mon, May 08, 2017 at 03:12:42PM -0700, prakash.sangappa wrote: > Regarding #3 as a general feature, do we want to > consider this and the complexity associated with the > implementation? We have to. Given that no one has exclusive access to hugetlbfs a mount option is fundamentally the wrong

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-09 Thread Christoph Hellwig
On Mon, May 08, 2017 at 03:12:42PM -0700, prakash.sangappa wrote: > Regarding #3 as a general feature, do we want to > consider this and the complexity associated with the > implementation? We have to. Given that no one has exclusive access to hugetlbfs a mount option is fundamentally the wrong

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-08 Thread prakash.sangappa
On 05/08/2017 08:58 AM, Dave Hansen wrote: It depends on how you define the feature. I think you have three choices: 1. "Error" on page fault. Require all access to be pre-faulted. 2. Allow faults, but "Error" if page cache has to be allocated 3. Allow faults and page cache allocations,

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-08 Thread prakash.sangappa
On 05/08/2017 08:58 AM, Dave Hansen wrote: It depends on how you define the feature. I think you have three choices: 1. "Error" on page fault. Require all access to be pre-faulted. 2. Allow faults, but "Error" if page cache has to be allocated 3. Allow faults and page cache allocations,

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-08 Thread Dave Hansen
On 05/03/2017 12:02 PM, Prakash Sangappa wrote: >>> If we do consider a new madvise()option, will it be acceptable >>> since this will be specifically for hugetlbfs file mappings? >> Ideally, it would be something that is *not* specifically for >> hugetlbfs. MADV_NOAUTOFILL, for instance, could be

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-08 Thread Dave Hansen
On 05/03/2017 12:02 PM, Prakash Sangappa wrote: >>> If we do consider a new madvise()option, will it be acceptable >>> since this will be specifically for hugetlbfs file mappings? >> Ideally, it would be something that is *not* specifically for >> hugetlbfs. MADV_NOAUTOFILL, for instance, could be

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-07 Thread Prakash Sangappa
On 5/3/17 12:02 PM, Prakash Sangappa wrote: On 5/2/17 4:43 PM, Dave Hansen wrote: Ideally, it would be something that is *not* specifically for hugetlbfs. MADV_NOAUTOFILL, for instance, could be defined to SIGSEGV whenever memory is touched that was not populated with MADV_WILLNEED,

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-07 Thread Prakash Sangappa
On 5/3/17 12:02 PM, Prakash Sangappa wrote: On 5/2/17 4:43 PM, Dave Hansen wrote: Ideally, it would be something that is *not* specifically for hugetlbfs. MADV_NOAUTOFILL, for instance, could be defined to SIGSEGV whenever memory is touched that was not populated with MADV_WILLNEED,

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-03 Thread Prakash Sangappa
On 5/2/17 4:43 PM, Dave Hansen wrote: On 05/02/2017 04:34 PM, Prakash Sangappa wrote: Similarly, a madvise() option also requires additional system call by every process mapping the file, this is considered a overhead for the database. How long-lived are these processes? For a database, I'd

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-03 Thread Prakash Sangappa
On 5/2/17 4:43 PM, Dave Hansen wrote: On 05/02/2017 04:34 PM, Prakash Sangappa wrote: Similarly, a madvise() option also requires additional system call by every process mapping the file, this is considered a overhead for the database. How long-lived are these processes? For a database, I'd

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-02 Thread Dave Hansen
On 05/02/2017 04:34 PM, Prakash Sangappa wrote: > Similarly, a madvise() option also requires additional system call by every > process mapping the file, this is considered a overhead for the database. How long-lived are these processes? For a database, I'd assume that this would happen a single

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-02 Thread Dave Hansen
On 05/02/2017 04:34 PM, Prakash Sangappa wrote: > Similarly, a madvise() option also requires additional system call by every > process mapping the file, this is considered a overhead for the database. How long-lived are these processes? For a database, I'd assume that this would happen a single

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-02 Thread Prakash Sangappa
On 5/2/17 2:32 PM, Dave Hansen wrote: On 05/01/2017 11:00 AM, Prakash Sangappa wrote: This patch adds a new hugetlbfs mount option 'noautofill', to indicate that pages should not be allocated at page fault time when accessed thru mmapped address. I think the main argument against doing

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-02 Thread Prakash Sangappa
On 5/2/17 2:32 PM, Dave Hansen wrote: On 05/01/2017 11:00 AM, Prakash Sangappa wrote: This patch adds a new hugetlbfs mount option 'noautofill', to indicate that pages should not be allocated at page fault time when accessed thru mmapped address. I think the main argument against doing

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-02 Thread Dave Hansen
On 05/01/2017 11:00 AM, Prakash Sangappa wrote: > This patch adds a new hugetlbfs mount option 'noautofill', to indicate that > pages should not be allocated at page fault time when accessed thru mmapped > address. I think the main argument against doing something like this is further

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-02 Thread Dave Hansen
On 05/01/2017 11:00 AM, Prakash Sangappa wrote: > This patch adds a new hugetlbfs mount option 'noautofill', to indicate that > pages should not be allocated at page fault time when accessed thru mmapped > address. I think the main argument against doing something like this is further

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-02 Thread Prakash Sangappa
On 5/2/17 3:53 AM, Anshuman Khandual wrote: On 05/01/2017 11:30 PM, Prakash Sangappa wrote: Some applications like a database use hugetblfs for performance reasons. Files on hugetlbfs filesystem are created and huge pages allocated using fallocate() API. Pages are deallocated/freed using

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-02 Thread Prakash Sangappa
On 5/2/17 3:53 AM, Anshuman Khandual wrote: On 05/01/2017 11:30 PM, Prakash Sangappa wrote: Some applications like a database use hugetblfs for performance reasons. Files on hugetlbfs filesystem are created and huge pages allocated using fallocate() API. Pages are deallocated/freed using

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-02 Thread Anshuman Khandual
On 05/01/2017 11:30 PM, Prakash Sangappa wrote: > Some applications like a database use hugetblfs for performance > reasons. Files on hugetlbfs filesystem are created and huge pages > allocated using fallocate() API. Pages are deallocated/freed using > fallocate() hole punching support that has

Re: [PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-02 Thread Anshuman Khandual
On 05/01/2017 11:30 PM, Prakash Sangappa wrote: > Some applications like a database use hugetblfs for performance > reasons. Files on hugetlbfs filesystem are created and huge pages > allocated using fallocate() API. Pages are deallocated/freed using > fallocate() hole punching support that has

[PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-01 Thread Prakash Sangappa
Some applications like a database use hugetblfs for performance reasons. Files on hugetlbfs filesystem are created and huge pages allocated using fallocate() API. Pages are deallocated/freed using fallocate() hole punching support that has been added to hugetlbfs. These files are mmapped and

[PATCH RFC] hugetlbfs 'noautofill' mount option

2017-05-01 Thread Prakash Sangappa
Some applications like a database use hugetblfs for performance reasons. Files on hugetlbfs filesystem are created and huge pages allocated using fallocate() API. Pages are deallocated/freed using fallocate() hole punching support that has been added to hugetlbfs. These files are mmapped and