Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1695498

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite
Date 2017-07-25 10:50 +0200
Message-ID <u73Hr-x2-3@gated-at.bofh.it> (permalink)
References (5 earlier) <u2Kk2-4UU-23@gated-at.bofh.it> <u2KtH-4Y8-1@gated-at.bofh.it> <u32Ai-84Q-23@gated-at.bofh.it> <u5GDg-5xh-5@gated-at.bofh.it> <u71FE-7Lw-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jul 25, 2017 at 03:29:45PM +0900, Byungchul Park wrote:

> _No_, as I already said.
> 
> > (/me copy paste from older email)
> > 
> > That gives:
> > 
> >         xhist[ 0] = A1
> >         xhist[ 1] = B1
> >         ...
> >         xhist[63] = B63
> > 
> > then we wrap and have:
> > 
> >         xhist[0] = B64
> > 
> > then we rewind to 1 and invalidate to arrive at:
> 
> We invalidate xhist[_0_], as I already said.
> 
> >         xhist[ 0] = B64
> >         xhist[ 1] = NULL   <-- idx
> >         xhist[ 2] = B2
> >         ...
> >         xhist[63] = B63
> > 
> > 
> > Then we do D and get
> > 
> >         xhist[ 0] = B64
> >         xhist[ 1] = D   <-- idx
> >         xhist[ 2] = B2
> >         ...
> >         xhist[63] = B63
> 
> We should get
> 
>          xhist[ 0] = NULL
>          xhist[ 1] = D   <-- idx
>          xhist[ 2] = B2
>          ...
>          xhist[63] = B63
> 
> By the way, did not you get my reply? I did exactly same answer.
> Perhaps You have not received or read my replies.
> 
> > And now there is nothing that will invalidate B*, after all, the
> > gen_id's are all after C's stamp, and the same_context_xhlock() test
> > will also pass because they're all from IRQ context (albeit not the
> > same, but it cannot tell).
> 
> It will stop at xhist[0] because it has been invalidated.
> 
> > Does this explain? Or am I still missing something?
> 
> Could you read the following reply? Not enough?
> 
> https://lkml.org/lkml/2017/7/13/214
> 
> I am sorry if my english makes you hard to understand. But I already
> answered all you asked.

Ah, I think I see. It works because you commit backwards and terminate
on the invalidate.

Yes I had seen your emails, but the penny hadn't dropped, the light bulb
didn't switch on, etc.. sometimes I'm a little dense and need a little
more help.

Thanks, I'll go look at your latest posting now.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring  buffer overwrite Peter Zijlstra <peterz@infradead.org> - 2017-07-21 16:00 +0200
  Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring  buffer overwrite Byungchul Park <byungchul.park@lge.com> - 2017-07-25 08:40 +0200
    Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring  buffer overwrite Peter Zijlstra <peterz@infradead.org> - 2017-07-25 10:50 +0200

csiph-web