Re: "warning: context imbalance" in kernel/bpf/hashtab.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 05, 2020 at 01:18:02PM -0800, Linus Torvalds wrote:
> On Thu, Nov 5, 2020 at 1:13 PM Luc Van Oostenryck
> <luc.vanoostenryck@xxxxxxxxx> wrote:
> >
> > Annotations can't fix anything here. The patch [1] changes htab_lock_bucket(),
> > into conditionally taking a lock while before it took it unconditionally.
> > So, each point where its value is tested now becomes the confluence of 2
> > distinct paths: one with the lock taken and one with the lock not taken.
> > This is what is meant by 'context imbalance'.
> 
> I think the point Song makes is that if sparse did a few more
> optimizations, it would see the context imbalance go away, because the
> value it tests would become constant.

It's not how I understood it, but yes, I agree. It's what I tried to
briefly explain the in the last paragraph.

>From what I know from these situations, in most cases, simple
'expression' optimizations are not enough but simple forms of
code hoisting would often anything that's needed.

-- Luc



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux