[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53fb660a657848a29ba80040ec99c777@AcuMS.aculab.com>
Date: Tue, 8 Dec 2020 13:13:50 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Peter Zijlstra' <peterz@...radead.org>
CC: 'Waiman Long' <longman@...hat.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Jann Horn <jannh@...gle.com>,
Vasiliy Kulikov <segoon@...nwall.com>,
Al Viro <viro@...iv.linux.org.uk>,
Bernd Edlinger <bernd.edlinger@...mail.de>,
Oleg Nesterov <oleg@...hat.com>,
"Christopher Yeoh" <cyeoh@....ibm.com>,
Cyrill Gorcunov <gorcunov@...il.com>,
"Sargun Dhillon" <sargun@...gun.me>,
Christian Brauner <christian.brauner@...ntu.com>,
Arnd Bergmann <arnd@...db.de>,
"Arnaldo Carvalho de Melo" <acme@...nel.org>
Subject: RE: [PATCH 2/3] rwsem: Implement down_read_interruptible
From: Peter Zijlstra
> Sent: 08 December 2020 12:32
>
> On Tue, Dec 08, 2020 at 09:12:36AM +0000, David Laight wrote:
> > From: Waiman Long
> > > Sent: 07 December 2020 19:02
> > ...
> > > > How much more difficult would it be to also add a timeout option?
> > > > I looked at adding one to the mutex code - and fell into a big pile
> > > > of replicated code.
> > > >
> > > > ISTM that one the initial locked exchange (and spin) fails a few
> > > > extra instructions when heading for the sleep don't really matter
> > > >
> > > Actually, I had tried that before. See
> > >
> > > https://lore.kernel.org/lkml/20190911150537.19527-1-longman@redhat.com/
> > >
> > > That is for rwsem, but the same can be done for mutex. However, Peter
> > > didn't seem to like the idea of a timeout parameter. Anyway, it is
> > > certainly doable if there is a good use case for it.
> >
> > 'Unfortunately' my use-case if for an out-of-tree driver.
> >
> > The problem I was solving is a status call blocking because
> > some other code is 'stuck' (probably an oops) with a mutex held.
>
> Working around oopses is not a sane use-case. If you oops, you get to
> keep all the pieces.
It's not so much 'working around' as trying to get debug info out
to fix the bug.
It gets annoying when another process lock up.
ISTR there is something global of that nature after a panic.
I have written a version that reported an error if the process
holding the mutex is dead (wasn't race safe against process exit).
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists