Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Peter Zijlstra
On Thu, May 07, 2015 at 02:14:39PM +0200, David Hildenbrand wrote: > Thanks :), well just to make sure I got your opinion on this correctly: > > 1. You think that 2 counters is the way to go for now ack > 2. You agree that we can't replace preempt_disable()+pagefault_disable() with >

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Ingo Molnar
* David Hildenbrand wrote: > @Ingo, do you have a strong feeling against this whole > patchset/idea? No objections, sounds good to me now. Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread David Hildenbrand
> On Thu, May 07, 2015 at 01:40:30PM +0200, David Hildenbrand wrote: > > But anyhow, opinions seem to differ how to best handle that whole stuff. > > > > I think a separate counter just makes sense, as we are dealing with two > > different concepts and we don't want to lose the preempt_disable =^

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Peter Zijlstra
On Thu, May 07, 2015 at 01:40:30PM +0200, David Hildenbrand wrote: > But anyhow, opinions seem to differ how to best handle that whole stuff. > > I think a separate counter just makes sense, as we are dealing with two > different concepts and we don't want to lose the preempt_disable =^ NOP > for

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Peter Zijlstra
On Thu, May 07, 2015 at 01:40:30PM +0200, David Hildenbrand wrote: > I think a separate counter just makes sense, as we are dealing with two > different concepts and we don't want to lose the preempt_disable =^ NOP > for !CONFIG_PREEMPT. Right, let me try and get my head on straight -- I'm so

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Peter Zijlstra
On Thu, May 07, 2015 at 01:23:35PM +0200, David Hildenbrand wrote: > > On Thu, May 07, 2015 at 12:50:53PM +0200, David Hildenbrand wrote: > > > Just to make sure we have a common understanding (as written in my cover > > > letter): > > > > > > Your suggestion won't work with !CONFIG_PREEMPT

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread David Hildenbrand
> On Thu, May 07, 2015 at 12:50:53PM +0200, David Hildenbrand wrote: > > Just to make sure we have a common understanding (as written in my cover > > letter): > > > > Your suggestion won't work with !CONFIG_PREEMPT (!CONFIG_PREEMPT_COUNT). If > > there is no preempt counter, in_atomic() won't

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread David Hildenbrand
> > * David Hildenbrand wrote: > > > > On Thu, May 07, 2015 at 12:50:53PM +0200, David Hildenbrand wrote: > > > > Just to make sure we have a common understanding (as written in my cover > > > > letter): > > > > > > > > Your suggestion won't work with !CONFIG_PREEMPT > > > >

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Ingo Molnar
* David Hildenbrand wrote: > > On Thu, May 07, 2015 at 12:50:53PM +0200, David Hildenbrand wrote: > > > Just to make sure we have a common understanding (as written in my cover > > > letter): > > > > > > Your suggestion won't work with !CONFIG_PREEMPT (!CONFIG_PREEMPT_COUNT). > > > If > > >

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread David Hildenbrand
> On Thu, May 07, 2015 at 12:50:53PM +0200, David Hildenbrand wrote: > > Just to make sure we have a common understanding (as written in my cover > > letter): > > > > Your suggestion won't work with !CONFIG_PREEMPT (!CONFIG_PREEMPT_COUNT). If > > there is no preempt counter, in_atomic() won't

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Peter Zijlstra
On Thu, May 07, 2015 at 12:50:53PM +0200, David Hildenbrand wrote: > Just to make sure we have a common understanding (as written in my cover > letter): > > Your suggestion won't work with !CONFIG_PREEMPT (!CONFIG_PREEMPT_COUNT). If > there is no preempt counter, in_atomic() won't work. But

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Ingo Molnar
* David Hildenbrand wrote: > > AFAICR we did this to avoid having to do both: > > > > preempt_disable(); > > pagefault_disable(); > > > > in a fair number of places -- just like this patch-set does, this is > > touching two cachelines where one would have been enough. > > > > Also,

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread David Hildenbrand
> On Wed, May 06, 2015 at 07:50:25PM +0200, David Hildenbrand wrote: > > +/* > > + * Is the pagefault handler disabled? If so, user access methods will not > > sleep. > > + */ > > +#define pagefault_disabled() (current->pagefault_disabled != 0) > > So -RT has: > > static inline bool

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Peter Zijlstra
On Wed, May 06, 2015 at 07:50:25PM +0200, David Hildenbrand wrote: > +/* > + * Is the pagefault handler disabled? If so, user access methods will not > sleep. > + */ > +#define pagefault_disabled() (current->pagefault_disabled != 0) So -RT has: static inline bool pagefault_disabled(void) {

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Peter Zijlstra
On Thu, May 07, 2015 at 12:50:53PM +0200, David Hildenbrand wrote: Just to make sure we have a common understanding (as written in my cover letter): Your suggestion won't work with !CONFIG_PREEMPT (!CONFIG_PREEMPT_COUNT). If there is no preempt counter, in_atomic() won't work. But there

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Ingo Molnar
* David Hildenbrand d...@linux.vnet.ibm.com wrote: AFAICR we did this to avoid having to do both: preempt_disable(); pagefault_disable(); in a fair number of places -- just like this patch-set does, this is touching two cachelines where one would have been enough.

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Ingo Molnar
* David Hildenbrand d...@linux.vnet.ibm.com wrote: On Thu, May 07, 2015 at 12:50:53PM +0200, David Hildenbrand wrote: Just to make sure we have a common understanding (as written in my cover letter): Your suggestion won't work with !CONFIG_PREEMPT (!CONFIG_PREEMPT_COUNT). If

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread David Hildenbrand
* David Hildenbrand d...@linux.vnet.ibm.com wrote: On Thu, May 07, 2015 at 12:50:53PM +0200, David Hildenbrand wrote: Just to make sure we have a common understanding (as written in my cover letter): Your suggestion won't work with !CONFIG_PREEMPT

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread David Hildenbrand
On Thu, May 07, 2015 at 12:50:53PM +0200, David Hildenbrand wrote: Just to make sure we have a common understanding (as written in my cover letter): Your suggestion won't work with !CONFIG_PREEMPT (!CONFIG_PREEMPT_COUNT). If there is no preempt counter, in_atomic() won't work. But

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Peter Zijlstra
On Thu, May 07, 2015 at 01:40:30PM +0200, David Hildenbrand wrote: I think a separate counter just makes sense, as we are dealing with two different concepts and we don't want to lose the preempt_disable =^ NOP for !CONFIG_PREEMPT. Right, let me try and get my head on straight -- I'm so used

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Peter Zijlstra
On Thu, May 07, 2015 at 01:23:35PM +0200, David Hildenbrand wrote: On Thu, May 07, 2015 at 12:50:53PM +0200, David Hildenbrand wrote: Just to make sure we have a common understanding (as written in my cover letter): Your suggestion won't work with !CONFIG_PREEMPT

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Peter Zijlstra
On Thu, May 07, 2015 at 02:14:39PM +0200, David Hildenbrand wrote: Thanks :), well just to make sure I got your opinion on this correctly: 1. You think that 2 counters is the way to go for now ack 2. You agree that we can't replace preempt_disable()+pagefault_disable() with

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Peter Zijlstra
On Thu, May 07, 2015 at 01:40:30PM +0200, David Hildenbrand wrote: But anyhow, opinions seem to differ how to best handle that whole stuff. I think a separate counter just makes sense, as we are dealing with two different concepts and we don't want to lose the preempt_disable =^ NOP for

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Peter Zijlstra
On Wed, May 06, 2015 at 07:50:25PM +0200, David Hildenbrand wrote: +/* + * Is the pagefault handler disabled? If so, user access methods will not sleep. + */ +#define pagefault_disabled() (current-pagefault_disabled != 0) So -RT has: static inline bool pagefault_disabled(void) {

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread David Hildenbrand
On Wed, May 06, 2015 at 07:50:25PM +0200, David Hildenbrand wrote: +/* + * Is the pagefault handler disabled? If so, user access methods will not sleep. + */ +#define pagefault_disabled() (current-pagefault_disabled != 0) So -RT has: static inline bool pagefault_disabled(void) {

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread David Hildenbrand
On Thu, May 07, 2015 at 12:50:53PM +0200, David Hildenbrand wrote: Just to make sure we have a common understanding (as written in my cover letter): Your suggestion won't work with !CONFIG_PREEMPT (!CONFIG_PREEMPT_COUNT). If there is no preempt counter, in_atomic() won't work. But

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread David Hildenbrand
On Thu, May 07, 2015 at 01:40:30PM +0200, David Hildenbrand wrote: But anyhow, opinions seem to differ how to best handle that whole stuff. I think a separate counter just makes sense, as we are dealing with two different concepts and we don't want to lose the preempt_disable =^ NOP

Re: [PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-07 Thread Ingo Molnar
* David Hildenbrand d...@linux.vnet.ibm.com wrote: @Ingo, do you have a strong feeling against this whole patchset/idea? No objections, sounds good to me now. Thanks, Ingo -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to

[PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-06 Thread David Hildenbrand
Until now, pagefault_disable()/pagefault_enabled() used the preempt count to track whether in an environment with pagefaults disabled (can be queried via in_atomic()). This patch introduces a separate counter in task_struct to count the level of pagefault_disable() calls. We'll keep manipulating

[PATCH RFC 01/15] uaccess: count pagefault_disable() levels in pagefault_disabled

2015-05-06 Thread David Hildenbrand
Until now, pagefault_disable()/pagefault_enabled() used the preempt count to track whether in an environment with pagefaults disabled (can be queried via in_atomic()). This patch introduces a separate counter in task_struct to count the level of pagefault_disable() calls. We'll keep manipulating