Re: [PATCH] ubi: check kthread_should_stop() after the setting of task state

2020-09-13 Thread Richard Weinberger
On Sat, Aug 8, 2020 at 5:26 AM Zhihao Cheng wrote: > 在 2020/8/8 3:29, Richard Weinberger 写道: > > On Fri, Aug 7, 2020 at 4:18 AM Zhihao Cheng wrote: > > > Maybe it's just me being dense and in need for a vacation. ;-) Applied to fixes. :-) -- Thanks, //richard

Re: [PATCH] ubi: check kthread_should_stop() after the setting of task state

2020-08-07 Thread Zhihao Cheng
在 2020/8/8 3:29, Richard Weinberger 写道: On Fri, Aug 7, 2020 at 4:18 AM Zhihao Cheng wrote: Maybe it's just me being dense and in need for a vacation. ;-) I have quite a few ubi/ubifs patches in pending list, may you comment/check them before 5.9 ending please? thanks. \( ̄▽ ̄) For example:

Re: [PATCH] ubi: check kthread_should_stop() after the setting of task state

2020-08-07 Thread Richard Weinberger
On Fri, Aug 7, 2020 at 4:18 AM Zhihao Cheng wrote: > That's where we hold different views. I have 3 viewpoints(You can point > out which one you disagree.): > > 1. If kthread_stop() happens at line 12, ubi thread is *marked* with > stop flag, it will stop at kthread_should_stop() as long as it

Re: [PATCH] ubi: check kthread_should_stop() after the setting of task state

2020-08-06 Thread Zhihao Cheng
在 2020/8/7 4:15, Richard Weinberger 写道: On Wed, Aug 5, 2020 at 4:23 AM Zhihao Cheng wrote: Er, I can't get the point. I can list two possible situations, did I miss other situations? Yes. You keep ignoring the case I brought up. Let's start from scratch, maybe I miss something. So I'm sorry

Re: [PATCH] ubi: check kthread_should_stop() after the setting of task state

2020-08-06 Thread Richard Weinberger
On Wed, Aug 5, 2020 at 4:23 AM Zhihao Cheng wrote: > Er, I can't get the point. I can list two possible situations, did I > miss other situations? Yes. You keep ignoring the case I brought up. Let's start from scratch, maybe I miss something. So I'm sorry for being persistent. The ubi thread

Re: [PATCH] ubi: check kthread_should_stop() after the setting of task state

2020-08-04 Thread Zhihao Cheng
在 2020/8/5 5:56, Richard Weinberger 写道: On Tue, Aug 4, 2020 at 4:58 AM Zhihao Cheng wrote: Oh, you're thinking about influence by schedule(), I get it. But I think it still works. Because the ubi_thread is still on runqueue, it will be scheduled to execute later anyway. It will not get woken.

Re: [PATCH] ubi: check kthread_should_stop() after the setting of task state

2020-08-04 Thread Richard Weinberger
On Tue, Aug 4, 2020 at 4:58 AM Zhihao Cheng wrote: > Oh, you're thinking about influence by schedule(), I get it. But I think > it still works. Because the ubi_thread is still on runqueue, it will be > scheduled to execute later anyway. It will not get woken. This is the problem. > > op

Re: [PATCH] ubi: check kthread_should_stop() after the setting of task state

2020-08-03 Thread Zhihao Cheng
在 2020/8/4 6:11, Richard Weinberger 写道: On Mon, Aug 3, 2020 at 4:01 AM Zhihao Cheng wrote: Hmm, I see the problem but I fear this patch does not cure the race completely. It just lowers the chance to hit it. What if KTHREAD_SHOULD_STOP is set right after you checked for it? The patch can

Re: [PATCH] ubi: check kthread_should_stop() after the setting of task state

2020-08-03 Thread Richard Weinberger
On Mon, Aug 3, 2020 at 4:01 AM Zhihao Cheng wrote: > > Hmm, I see the problem but I fear this patch does not cure the race > > completely. > > It just lowers the chance to hit it. > > What if KTHREAD_SHOULD_STOP is set right after you checked for it? > > The patch can handle this case.

Re: [PATCH] ubi: check kthread_should_stop() after the setting of task state

2020-08-02 Thread Zhihao Cheng
在 2020/8/3 5:25, Richard Weinberger 写道: On Mon, Jun 1, 2020 at 11:13 AM Zhihao Cheng wrote: A detach hung is possible when a race occurs between the detach process and the ubi background thread. The following sequences outline the race: ubi thread: if (list_empty(>works)... ubi detach:

Re: [PATCH] ubi: check kthread_should_stop() after the setting of task state

2020-08-02 Thread Richard Weinberger
On Mon, Jun 1, 2020 at 11:13 AM Zhihao Cheng wrote: > > A detach hung is possible when a race occurs between the detach process > and the ubi background thread. The following sequences outline the race: > > ubi thread: if (list_empty(>works)... > > ubi detach: set_bit(KTHREAD_SHOULD_STOP,

[PATCH] ubi: check kthread_should_stop() after the setting of task state

2020-06-01 Thread Zhihao Cheng
A detach hung is possible when a race occurs between the detach process and the ubi background thread. The following sequences outline the race: ubi thread: if (list_empty(>works)... ubi detach: set_bit(KTHREAD_SHOULD_STOP, >flags) => by kthread_stop()