Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-29 Thread Michal Hocko
On Tue 29-09-20 11:00:03, Daniel Vetter wrote: > On Tue, Sep 29, 2020 at 10:19:38AM +0200, Michal Hocko wrote: > > On Wed 16-09-20 23:43:02, Daniel Vetter wrote: > > > I can > > > then figure out whether it's better to risk not spotting issues with > > > call_rcu vs slapping a memalloc_noio_save/re

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-29 Thread Daniel Vetter
On Tue, Sep 29, 2020 at 10:19:38AM +0200, Michal Hocko wrote: > On Wed 16-09-20 23:43:02, Daniel Vetter wrote: > > I can > > then figure out whether it's better to risk not spotting issues with > > call_rcu vs slapping a memalloc_noio_save/restore around all these > > critical section which force-d

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-29 Thread Michal Hocko
On Wed 16-09-20 23:43:02, Daniel Vetter wrote: > I can > then figure out whether it's better to risk not spotting issues with > call_rcu vs slapping a memalloc_noio_save/restore around all these > critical section which force-degrades any allocation to GFP_ATOMIC at did you mean memalloc_noreclaim

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-17 Thread Paul E. McKenney
On Thu, Sep 17, 2020 at 09:52:30AM +0200, Daniel Vetter wrote: > On Thu, Sep 17, 2020 at 12:39 AM Paul E. McKenney wrote: > > > > On Wed, Sep 16, 2020 at 11:43:02PM +0200, Daniel Vetter wrote: > > > On Wed, Sep 16, 2020 at 10:58 PM Paul E. McKenney > > > wrote: > > > > > > > > On Wed, Sep 16, 20

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-17 Thread Daniel Vetter
On Thu, Sep 17, 2020 at 12:39 AM Paul E. McKenney wrote: > > On Wed, Sep 16, 2020 at 11:43:02PM +0200, Daniel Vetter wrote: > > On Wed, Sep 16, 2020 at 10:58 PM Paul E. McKenney > > wrote: > > > > > > On Wed, Sep 16, 2020 at 10:29:06PM +0200, Daniel Vetter wrote: > > > > On Wed, Sep 16, 2020 at

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-16 Thread Ard Biesheuvel
On Wed, 16 Sep 2020 at 21:32, Linus Torvalds wrote: > > But something like a driver list walking thing should not be doing > different things behind peoples back depending on whether they hold > spinlocks or not. It should either just work regardless, or there > should be a flag (or special interf

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-16 Thread Paul E. McKenney
On Wed, Sep 16, 2020 at 11:43:02PM +0200, Daniel Vetter wrote: > On Wed, Sep 16, 2020 at 10:58 PM Paul E. McKenney wrote: > > > > On Wed, Sep 16, 2020 at 10:29:06PM +0200, Daniel Vetter wrote: > > > On Wed, Sep 16, 2020 at 5:29 PM Paul E. McKenney > > > wrote: > > > > > > > > On Wed, Sep 16, 202

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-16 Thread Daniel Vetter
On Wed, Sep 16, 2020 at 10:58 PM Paul E. McKenney wrote: > > On Wed, Sep 16, 2020 at 10:29:06PM +0200, Daniel Vetter wrote: > > On Wed, Sep 16, 2020 at 5:29 PM Paul E. McKenney wrote: > > > > > > On Wed, Sep 16, 2020 at 09:37:17AM +0200, Daniel Vetter wrote: > > > > On Tue, Sep 15, 2020 at 7:35 P

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-16 Thread Paul E. McKenney
On Wed, Sep 16, 2020 at 10:29:06PM +0200, Daniel Vetter wrote: > On Wed, Sep 16, 2020 at 5:29 PM Paul E. McKenney wrote: > > > > On Wed, Sep 16, 2020 at 09:37:17AM +0200, Daniel Vetter wrote: > > > On Tue, Sep 15, 2020 at 7:35 PM Linus Torvalds > > > wrote: > > > > > > > > On Tue, Sep 15, 2020 at

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-16 Thread Paul E. McKenney
On Wed, Sep 16, 2020 at 08:23:52PM +0100, Matthew Wilcox wrote: > On Mon, Sep 14, 2020 at 11:55:24PM +0200, Thomas Gleixner wrote: > > But just look at any check which uses preemptible(), especially those > > which check !preemptible(): > > hmm. > > +++ b/include/linux/preempt.h > @@ -180,7 +180,

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-16 Thread Paul E. McKenney
On Wed, Sep 16, 2020 at 11:32:00AM -0700, Linus Torvalds wrote: > On Wed, Sep 16, 2020 at 8:29 AM Paul E. McKenney wrote: > > > > All fair, but some of us need to write code that must handle being > > invoked from a wide variety of contexts. > > Note that I think that core functionality is differ

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-16 Thread Daniel Vetter
On Wed, Sep 16, 2020 at 5:29 PM Paul E. McKenney wrote: > > On Wed, Sep 16, 2020 at 09:37:17AM +0200, Daniel Vetter wrote: > > On Tue, Sep 15, 2020 at 7:35 PM Linus Torvalds > > wrote: > > > > > > On Tue, Sep 15, 2020 at 1:39 AM Thomas Gleixner > > > wrote: > > > > > > > > OTOH, having a workin

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-16 Thread Matthew Wilcox
On Mon, Sep 14, 2020 at 11:55:24PM +0200, Thomas Gleixner wrote: > But just look at any check which uses preemptible(), especially those > which check !preemptible(): hmm. +++ b/include/linux/preempt.h @@ -180,7 +180,9 @@ do { \ #define preempt_enable_no_resched() sched_preempt_enable_no_resch

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-16 Thread Paul E. McKenney
On Wed, Sep 16, 2020 at 09:37:17AM +0200, Daniel Vetter wrote: > On Tue, Sep 15, 2020 at 7:35 PM Linus Torvalds > wrote: > > > > On Tue, Sep 15, 2020 at 1:39 AM Thomas Gleixner wrote: > > > > > > OTOH, having a working 'preemptible()' or maybe better named > > > 'can_schedule()' check makes tons

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-16 Thread Linus Torvalds
On Tue, Sep 15, 2020 at 12:57 PM Thomas Gleixner wrote: > > You wish. I just found a 7 year old bug in a 10G network driver which > surely would have been found if people would enable debug configs and > not just run the crap on their PREEMPT_NONE, all debug off kernel. And > that driver is not su

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-16 Thread Linus Torvalds
On Wed, Sep 16, 2020 at 8:29 AM Paul E. McKenney wrote: > > All fair, but some of us need to write code that must handle being > invoked from a wide variety of contexts. Note that I think that core functionality is different from random drivers. Of course core code can (and will) look at things

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-16 Thread Daniel Vetter
On Tue, Sep 15, 2020 at 7:35 PM Linus Torvalds wrote: > > On Tue, Sep 15, 2020 at 1:39 AM Thomas Gleixner wrote: > > > > OTOH, having a working 'preemptible()' or maybe better named > > 'can_schedule()' check makes tons of sense to make decisions about > > allocation modes or other things. > > No

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-15 Thread Thomas Gleixner
On Tue, Sep 15 2020 at 10:35, Linus Torvalds wrote: > On Tue, Sep 15, 2020 at 1:39 AM Thomas Gleixner wrote: >> >> OTOH, having a working 'preemptible()' or maybe better named >> 'can_schedule()' check makes tons of sense to make decisions about >> allocation modes or other things. > > No. I think

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-15 Thread Linus Torvalds
On Tue, Sep 15, 2020 at 1:39 AM Thomas Gleixner wrote: > > OTOH, having a working 'preemptible()' or maybe better named > 'can_schedule()' check makes tons of sense to make decisions about > allocation modes or other things. No. I think that those kinds of decisions about actual behavior are alwa

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-15 Thread Linus Torvalds
On Tue, Sep 15, 2020 at 12:24 AM Thomas Gleixner wrote: > > Alternatively we just make highmem a bit more expensive by making these > maps preemptible. RT is doing this for a long time and it's not that > horrible. Ack. In fact, I've wanted to start just removing kmap support entirely. At some p

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-15 Thread Paul E. McKenney
On Mon, Sep 14, 2020 at 01:59:15PM -0700, Linus Torvalds wrote: > On Mon, Sep 14, 2020 at 1:45 PM Thomas Gleixner wrote: > > > > Recently merged code does: > > > > gfp = preemptible() ? GFP_KERNEL : GFP_ATOMIC; > > > > Looks obviously correct, except for the fact that preemptible() is > >

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-15 Thread Thomas Gleixner
On Mon, Sep 14 2020 at 15:24, Linus Torvalds wrote: > On Mon, Sep 14, 2020 at 2:55 PM Thomas Gleixner wrote: >> >> Yes it does generate better code, but I tried hard to spot a difference >> in various metrics exposed by perf. It's all in the noise and I only >> can spot a difference when the actua

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-15 Thread Thomas Gleixner
On Mon, Sep 14 2020 at 23:39, Linus Torvalds wrote: > On Mon, Sep 14, 2020 at 11:24 PM Herbert Xu > wrote: >> > But another reason I tried to avoid kmap_atomic() is that it disables >> > preemption unconditionally, even on 64-bit architectures where HIGHMEM >> > is irrelevant. So using kmap_atomi

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-14 Thread Linus Torvalds
On Mon, Sep 14, 2020 at 11:24 PM Herbert Xu wrote: > > On Tue, Sep 15, 2020 at 09:20:59AM +0300, Ard Biesheuvel wrote: > > > > The documentation of kmap_atomic() states the following: > > > > * The use of kmap_atomic/kunmap_atomic is discouraged - kmap/kunmap > > * gives a more generic (and cach

Re: [patch 00/13] preempt: Make preempt count unconditional

2020-09-14 Thread Ard Biesheuvel
On Tue, 15 Sep 2020 at 01:43, Linus Torvalds wrote: > > On Mon, Sep 14, 2020 at 3:24 PM Linus Torvalds > wrote: > > > > Ard and Herbert added to participants: see > > chacha20poly1305_crypt_sg_inplace(), which does > > > > flags = SG_MITER_TO_SG; > > if (!preemptible()) > >