[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACT4Y+ZaoB7t7DYwrdf6cQ3m_n5=Jz5800zEdpF1oT070bt66A@mail.gmail.com>
Date: Wed, 9 Jan 2019 06:35:37 +0100
From: Dmitry Vyukov <dvyukov@...gle.com>
To: Anatol Pomozov <anatol.pomozov@...il.com>
Cc: Andrea Parri <andrea.parri@...rulasolutions.com>,
Florian Westphal <fw@...len.de>,
Paul McKenney <paulmck@...ux.ibm.com>,
LKML <linux-kernel@...r.kernel.org>,
Andrey Konovalov <andreyknvl@...gle.com>
Subject: Re: seqcount usage in xt_replace_table()
On Wed, Jan 9, 2019 at 1:36 AM Anatol Pomozov <anatol.pomozov@...il.com> wrote:
>
> Hello
>
> On Tue, Jan 8, 2019 at 4:02 PM Andrea Parri
> <andrea.parri@...rulasolutions.com> wrote:
> >
> > Hi Anatol,
> >
> > On Tue, Jan 08, 2019 at 11:33:39AM -0800, Anatol Pomozov wrote:
> > > Hello folks,
> > >
> > > A bit of context what I am doing. I am trying to port KTSAN (Kernel
> > > Thread Sanitizer) tool to v4.20. That tool tracks shared data usage
> > > and makes sure it is accessed in a thread-safe manner.
> >
> > Interesting! FYI, some LKMM's maintainers (Paul included) had and
> > continued to have some "fun" discussing topics related to "thread-
> > safe memory accesses": I'm sure that they'll be very interested in
> > such work of yours and eager to discuss your results.
>
> Thread Sanitizer is a great tool to find thread-safety issues with
> user-space code. The tool been developed by a team of smart people
> from Google [1].
>
> KTSAN is an attempt to bring the same ideas to Linux kernel [2]. A
> bunch of work been done there but the project is still at
> proof-of-concept point.
>
> I am not a part of Google's dynamic tools team. But I've decided to
> pick something to do during the New Year holidays so started porting
> KTSAN from v4.2 to v4.20. The work is "almost completed" but I need to
> fix a few crashes [3].
>
> [1] https://github.com/google/sanitizers
> [2] https://github.com/google/ktsan/wiki
> [3] https://github.com/anatol/linux/tree/ktsan_4.20
For completeness, at the time we also had to add
read_seqcount_cancel() function to dynamically mark all seqcount read
regions. It can be used here too, start read region and immediately
end it. Less clear than raw_read_seqcount_nocritical(), but also less
API surface.
/**
* read_seqcount_cancel - cancel a seq-read critical section
* @s: pointer to seqcount_t
*
* This is a no-op except for ktsan, it needs to know scopes of seq-read
* critical sections. The sections are denoted either by begin->retry or
* by begin->cancel.
*/
static inline void read_seqcount_cancel(const seqcount_t *s)
{
ktsan_seqcount_end(s);
}
https://github.com/google/ktsan/blob/tsan/include/linux/seqlock.h#L235-L246
Powered by blists - more mailing lists