[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87si3bpaxy.fsf@notabene.neil.brown.name>
Date: Thu, 10 Dec 2015 08:30:01 +1100
From: NeilBrown <nfbrown@...ell.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: torvalds@...ux-foundation.org, tglx@...utronix.de,
linux-kernel@...r.kernel.org, efault@....de, mingo@...nel.org,
hpa@...or.com, vladimir.murzin@....com,
linux-tip-commits@...r.kernel.org, jstancek@...hat.com,
Oleg Nesterov <oleg@...hat.com>
Subject: Re: [tip:locking/core] sched/wait: Fix signal handling in bit wait helpers
On Wed, Dec 09 2015, Peter Zijlstra wrote:
> On Wed, Dec 09, 2015 at 12:06:33PM +1100, NeilBrown wrote:
>> On Tue, Dec 08 2015, Peter Zijlstra wrote:
>>
>> >>
>> >
>> > *sigh*, so that patch was broken.. the below might fix it, but please
>> > someone look at it, I seem to have a less than stellar track record
>> > here...
>>
>> This new change seems to be more intrusive than should be needed.
>> Can't we just do:
>>
>>
>> __sched int bit_wait(struct wait_bit_key *word)
>> {
>> + long state = current->state;
>
> No, current->state can already be changed by this time.
Does that matter?
It can only have changed to TASK_RUNNING - right?
In that case signal_pending_state() will return 0 and the bit_wait() acts
as though the thread was woken up normally (which it was) rather than by
a signal (which maybe it was too, but maybe that happened just a tiny
bit later).
As long as signal delivery doesn't change ->state, we should be safe.
We should even be safe testing ->state *after* the call the schedule().
NeilBrown
Download attachment "signature.asc" of type "application/pgp-signature" (819 bytes)
Powered by blists - more mailing lists