Re: [PATCH 3/3] task_work: use TIF_TASKWORK if available

2020-10-03 Thread Jens Axboe
On 10/2/20 7:49 PM, Thomas Gleixner wrote: > On Fri, Oct 02 2020 at 17:38, Oleg Nesterov wrote: >> On 10/02, Thomas Gleixner wrote: >>> >>> I think it's fundamentaly wrong that we have several places and several >>> flags which handle task_work_run() instead of having exactly one place >>> and one

Re: [PATCH 3/3] task_work: use TIF_TASKWORK if available

2020-10-02 Thread Thomas Gleixner
On Fri, Oct 02 2020 at 17:38, Oleg Nesterov wrote: > On 10/02, Thomas Gleixner wrote: >> >> I think it's fundamentaly wrong that we have several places and several >> flags which handle task_work_run() instead of having exactly one place >> and one flag. > > Damn yes, agreed. Actually there are

Re: [PATCH 3/3] task_work: use TIF_TASKWORK if available

2020-10-02 Thread Jens Axboe
On 10/2/20 1:10 PM, Thomas Gleixner wrote: > On Fri, Oct 02 2020 at 09:52, Jens Axboe wrote: >> On 10/2/20 9:31 AM, Thomas Gleixner wrote: This way task_work_run() doesn't need to clear TIF_NOTIFY_SIGNAL and it can have more users. >>> >>> I think it's fundamentaly wrong that we have

Re: [PATCH 3/3] task_work: use TIF_TASKWORK if available

2020-10-02 Thread Thomas Gleixner
On Fri, Oct 02 2020 at 09:52, Jens Axboe wrote: > On 10/2/20 9:31 AM, Thomas Gleixner wrote: >>> This way task_work_run() doesn't need to clear TIF_NOTIFY_SIGNAL and it can >>> have more users. >> >> I think it's fundamentaly wrong that we have several places and several >> flags which handle

Re: [PATCH 3/3] task_work: use TIF_TASKWORK if available

2020-10-02 Thread Jens Axboe
On 10/2/20 9:52 AM, Jens Axboe wrote: > On 10/2/20 9:31 AM, Thomas Gleixner wrote: >> On Fri, Oct 02 2020 at 17:14, Oleg Nesterov wrote: >>> Heh. To be honest I don't really like 1-2 ;) >> >> I do not like any of this :) >> >>> So I think that if we are going to add TIF_TASKWORK we should

Re: [PATCH 3/3] task_work: use TIF_TASKWORK if available

2020-10-02 Thread Jens Axboe
On 10/2/20 9:38 AM, Oleg Nesterov wrote: > On 10/02, Thomas Gleixner wrote: >> >> I think it's fundamentaly wrong that we have several places and several >> flags which handle task_work_run() instead of having exactly one place >> and one flag. > > Damn yes, agreed. As mentioned in the other

Re: [PATCH 3/3] task_work: use TIF_TASKWORK if available

2020-10-02 Thread Jens Axboe
On 10/2/20 9:14 AM, Oleg Nesterov wrote: > Heh. To be honest I don't really like 1-2 ;) > > Unfortunately, I do not see a better approach right now. Let me think > until Monday, it is not that I think I will find a better solution, but > I'd like to try anyway. > > Let me comment 3/3 for now.

Re: [PATCH 3/3] task_work: use TIF_TASKWORK if available

2020-10-02 Thread Jens Axboe
On 10/2/20 9:31 AM, Thomas Gleixner wrote: > On Fri, Oct 02 2020 at 17:14, Oleg Nesterov wrote: >> Heh. To be honest I don't really like 1-2 ;) > > I do not like any of this :) > >> So I think that if we are going to add TIF_TASKWORK we should generalize >> this logic and turn it into

Re: [PATCH 3/3] task_work: use TIF_TASKWORK if available

2020-10-02 Thread Oleg Nesterov
On 10/02, Thomas Gleixner wrote: > > I think it's fundamentaly wrong that we have several places and several > flags which handle task_work_run() instead of having exactly one place > and one flag. Damn yes, agreed. Oleg.

Re: [PATCH 3/3] task_work: use TIF_TASKWORK if available

2020-10-02 Thread Thomas Gleixner
On Fri, Oct 02 2020 at 17:14, Oleg Nesterov wrote: > Heh. To be honest I don't really like 1-2 ;) I do not like any of this :) > So I think that if we are going to add TIF_TASKWORK we should generalize > this logic and turn it into TIF_NOTIFY_SIGNAL. Similar to TIF_NOTIFY_RESUME > but implies

Re: [PATCH 3/3] task_work: use TIF_TASKWORK if available

2020-10-02 Thread Oleg Nesterov
Heh. To be honest I don't really like 1-2 ;) Unfortunately, I do not see a better approach right now. Let me think until Monday, it is not that I think I will find a better solution, but I'd like to try anyway. Let me comment 3/3 for now. On 10/01, Jens Axboe wrote: > > +static void

[PATCH 3/3] task_work: use TIF_TASKWORK if available

2020-10-01 Thread Jens Axboe
If the arch supports TIF_TASKWORK, then use that for TWA_SIGNAL as it's more efficient than using the signal delivery method. This is especially true on threaded applications, where ->sighand is shared across threads. Signed-off-by: Jens Axboe --- kernel/task_work.c | 48