On Fri, Nov 8, 2024 at 5:48 PM Hou Tao <houtao@xxxxxxxxxxxxxxx> wrote: > > Hi, > > On 11/9/2024 3:52 AM, Alexei Starovoitov wrote: > > On Wed, Nov 6, 2024 at 1:49 AM Hou Tao <houtao@xxxxxxxxxxxxxxx> wrote: > >> Hi, > >> > >> On 11/6/2024 4:45 PM, Sebastian Andrzej Siewior wrote: > >>> On 2024-11-06 14:35:39 [+0800], Hou Tao wrote: > >>>> From: Hou Tao <houtao1@xxxxxxxxxx> > >>>> > >>>> Hi, > >>> Hi Hou, > >>> > >>>> The patch set fixes a lockdep warning for htab of map. The > >>>> warning is found when running test_maps. The warning occurs when > >>>> htab_put_fd_value() attempts to acquire map_idr_lock to free the map id > >>>> of the inner map while already holding the bucket lock (raw_spinlock_t). > >>>> > >>>> The fix moves the invocation of free_htab_elem() after > >>>> htab_unlock_bucket() and adds a test case to verify the solution. Please > >>>> see the individual patches for details. Comments are always welcome. > > The fix makes sense. > > I manually resolved merge conflict and applied. > > Thanks for the manually conflict resolving. However, the patch set > doesn't move all free operations outside of lock scope (e.g., for > bpf_map_lookup_and_delete()), because htab of maps doesn't support it. I > could post another patch set to do that. Pls do. It's easier to review incrementally. For the last year we've been working on "resilient spin lock" and hope to post patches in a couple weeks. In those patches we will be replacing htab bucket lock with this new lock, so moving other locks out of htab lock region fits very well.