Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-25 Thread Mikulas Patocka
On Tue, 19 Sep 2017, Joe Lawrence wrote: > On 09/14/2017 07:09 PM, Mikulas Patocka wrote: > > > > I think this mutex is too heavy - if multiple processes simultaneously > > create a pipe, the mutex would cause performance degradation. > > > > You can call do_proc_dointvec with a custom callback

Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-25 Thread Mikulas Patocka
On Tue, 19 Sep 2017, Joe Lawrence wrote: > On 09/14/2017 07:09 PM, Mikulas Patocka wrote: > > > > I think this mutex is too heavy - if multiple processes simultaneously > > create a pipe, the mutex would cause performance degradation. > > > > You can call do_proc_dointvec with a custom callback

Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-21 Thread Mikulas Patocka
On Tue, 19 Sep 2017, Joe Lawrence wrote: > On 09/19/2017 03:53 AM, Mikulas Patocka wrote: > > On Fri, 15 Sep 2017, Joe Lawrence wrote: > > [ ... snip ... ] > >> Hi Mikulas, > >> > >> I'm not strong when it comes to memory barriers, but one of the > >> side-effects of using the mutex is that

Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-21 Thread Mikulas Patocka
On Tue, 19 Sep 2017, Joe Lawrence wrote: > On 09/19/2017 03:53 AM, Mikulas Patocka wrote: > > On Fri, 15 Sep 2017, Joe Lawrence wrote: > > [ ... snip ... ] > >> Hi Mikulas, > >> > >> I'm not strong when it comes to memory barriers, but one of the > >> side-effects of using the mutex is that

Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-19 Thread Joe Lawrence
On 09/14/2017 07:09 PM, Mikulas Patocka wrote: > On Tue, 5 Sep 2017, Joe Lawrence wrote: > >> pipe_max_size is assigned directly via procfs sysctl: >> >> static struct ctl_table fs_table[] = { >> ... >> { >> .procname = "pipe-max-size", >>

Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-19 Thread Joe Lawrence
On 09/14/2017 07:09 PM, Mikulas Patocka wrote: > On Tue, 5 Sep 2017, Joe Lawrence wrote: > >> pipe_max_size is assigned directly via procfs sysctl: >> >> static struct ctl_table fs_table[] = { >> ... >> { >> .procname = "pipe-max-size", >>

Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-19 Thread Joe Lawrence
On 09/19/2017 03:53 AM, Mikulas Patocka wrote: > On Fri, 15 Sep 2017, Joe Lawrence wrote: > [ ... snip ... ] >> Hi Mikulas, >> >> I'm not strong when it comes to memory barriers, but one of the >> side-effects of using the mutex is that pipe_set_size() and >> alloc_pipe_info() should have a

Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-19 Thread Joe Lawrence
On 09/19/2017 03:53 AM, Mikulas Patocka wrote: > On Fri, 15 Sep 2017, Joe Lawrence wrote: > [ ... snip ... ] >> Hi Mikulas, >> >> I'm not strong when it comes to memory barriers, but one of the >> side-effects of using the mutex is that pipe_set_size() and >> alloc_pipe_info() should have a

Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-19 Thread Mikulas Patocka
On Fri, 15 Sep 2017, Joe Lawrence wrote: > On 09/14/2017 07:09 PM, Mikulas Patocka wrote: > > On Tue, 5 Sep 2017, Joe Lawrence wrote: > >> pipe_max_size is assigned directly via procfs sysctl: > >> > >> static struct ctl_table fs_table[] = { > >> ... > >> { > >>

Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-19 Thread Mikulas Patocka
On Fri, 15 Sep 2017, Joe Lawrence wrote: > On 09/14/2017 07:09 PM, Mikulas Patocka wrote: > > On Tue, 5 Sep 2017, Joe Lawrence wrote: > >> pipe_max_size is assigned directly via procfs sysctl: > >> > >> static struct ctl_table fs_table[] = { > >> ... > >> { > >>

Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-15 Thread Joe Lawrence
On 09/14/2017 07:09 PM, Mikulas Patocka wrote: > On Tue, 5 Sep 2017, Joe Lawrence wrote: >> pipe_max_size is assigned directly via procfs sysctl: >> >> static struct ctl_table fs_table[] = { >> ... >> { >> .procname = "pipe-max-size", >>

Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-15 Thread Joe Lawrence
On 09/14/2017 07:09 PM, Mikulas Patocka wrote: > On Tue, 5 Sep 2017, Joe Lawrence wrote: >> pipe_max_size is assigned directly via procfs sysctl: >> >> static struct ctl_table fs_table[] = { >> ... >> { >> .procname = "pipe-max-size", >>

Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-14 Thread Mikulas Patocka
I think this mutex is too heavy - if multiple processes simultaneously create a pipe, the mutex would cause performance degradation. You can call do_proc_dointvec with a custom callback "conv" function that does the rounding of the pipe size value. Mikulas On Tue, 5 Sep 2017, Joe Lawrence

Re: [PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-14 Thread Mikulas Patocka
I think this mutex is too heavy - if multiple processes simultaneously create a pipe, the mutex would cause performance degradation. You can call do_proc_dointvec with a custom callback "conv" function that does the rounding of the pipe size value. Mikulas On Tue, 5 Sep 2017, Joe Lawrence

[PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-05 Thread Joe Lawrence
pipe_max_size is assigned directly via procfs sysctl: static struct ctl_table fs_table[] = { ... { .procname = "pipe-max-size", .data = _max_size, .maxlen = sizeof(int), .mode

[PATCH RFC 2/3] pipe: protect pipe_max_size access with a mutex

2017-09-05 Thread Joe Lawrence
pipe_max_size is assigned directly via procfs sysctl: static struct ctl_table fs_table[] = { ... { .procname = "pipe-max-size", .data = _max_size, .maxlen = sizeof(int), .mode