Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp667832ybl; Thu, 23 Jan 2020 05:43:29 -0800 (PST) X-Google-Smtp-Source: APXvYqzCSFwnRafSJt4xDPMP8Sw9hoB0YzdwIN6Il8e2Nn75wuKFM+e0rxaws+htF57uKqeIEZgC X-Received: by 2002:aca:75cc:: with SMTP id q195mr10397671oic.178.1579787009869; Thu, 23 Jan 2020 05:43:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579787009; cv=none; d=google.com; s=arc-20160816; b=pxtCmC0nduTTeDyySAAHFIglH5eUSRKVBPm1j2OeEh7OOYEU8qZCg4++ABNXvjNJ1/ NkwflP3l5Ob6XC40N/2bDSOUtt+FXhWrHG7/gUJcOsNRvTTWnaWnAXllNA/1f0p7IX8k 9ulXiw8Dq+LcsYvgtfBp0eY+HxO+Awr2BBQbQ0tz+m4+tN6La1b/Q8kyjPlx19hfARBF 5J3LRSCt2I3vufDI0BsjgeEIwTQEdwieSlIG0dT93xDnEelBlu0iE9RNVwOA/dCOZJvk Aq9gDyJ4THPZO3qsvyUUwpJE6pVGtr7ERjivAzWv/xXeOA2Ppd5WgqooGi/GZDGAa0OL kEQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=4DPy+R5bPTq7tZWsMUKnzOUpzVwlGaLd1jlg2QWm2Yw=; b=DphsNNRXEVZcEQ1JNheCdF9K9NeVSOd2ZvfaaMmfhA55z61lZsN7KXhDNsTEfi+VY7 0x4I8/isVjvvnHAfRPF3afWQ9tzvrsYbVpmrr7HujPCtpWeD4xTEVTrSMUBzb1Bcgg/V ntg+/co9WiMPSAOZCf4QYWhEMO4Y7C8PaV7/SXt3OjChyl1BKIGZZKCFl6hkLdkWdKD9 SUpSuCjS2Ue7dLjjo8y63q6A8M65QI34RL1+7YJvp6cqW7yn3MMxWHn6e0Q/gLeWi84b 4r0q75yOC3ggYL4p2okzVqEh1z/wowYgQhz6AQoFi/zmjQLKd599iJD54PKHO2RZ0BXa 6IwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gh3FccfZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l25si1078449otn.69.2020.01.23.05.43.18; Thu, 23 Jan 2020 05:43:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gh3FccfZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728899AbgAWNmN (ORCPT + 99 others); Thu, 23 Jan 2020 08:42:13 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:37937 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727453AbgAWNmK (ORCPT ); Thu, 23 Jan 2020 08:42:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579786929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4DPy+R5bPTq7tZWsMUKnzOUpzVwlGaLd1jlg2QWm2Yw=; b=gh3FccfZHQbdTBEoPpkCq3Sj9YltDkHOsX4YwEVafaDaM8K1gl8yldgXSHI0M50UO2XMzs KiuiMsfhNZB4+L7vVpyv1edys2aBmXjal7d4pCahBjrQfT8CZ+u5F4teRxl65mXCTKGZoS ZuECEAOq2SDwK6M5FXBTE68fr3f6xQk= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-272-dymhYEDpPJSf2nsddng15w-1; Thu, 23 Jan 2020 08:42:08 -0500 X-MC-Unique: dymhYEDpPJSf2nsddng15w-1 Received: by mail-lj1-f197.google.com with SMTP id r14so1078509ljc.18 for ; Thu, 23 Jan 2020 05:42:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=4DPy+R5bPTq7tZWsMUKnzOUpzVwlGaLd1jlg2QWm2Yw=; b=tLfuWpOpfdriHLAZaIm66gvU7M4DEEO9f1DV1QZuj0M2/t8yCrhxG84Nr45ODMBFdR 4TqXgRttehWio+JBQhtQntzgzkCb5bEjLXONUdOBLk8KElgbUmtj4JafoI4ySoqs1cT0 fXDbCy4knPTEabc8ogdGGrgegsAaNtcMKjBmNmKGxCjuZwTBNEFp6Nmp4EoTPE0nxIp5 LqydRMv42hhxsusOHLBGaNSEU/ZNt/MkeQToaPa+nd2FZlGyq8M2xhShU4bS+ZUhPSdH nx9YFI+CW9qpHH4jL7jbuo913c6D/Ait7mzz5XavdPIwdk1NQknAaYGpox4IEDCbV9Mg dtKg== X-Gm-Message-State: APjAAAXOMmGDxUX4U0nEg22bU+Wyt4BnXQE0L5N9Jq1MOja65/w8XdRi TpFQD4Ml2T2zIFGEk2FRbUko8yfbiNEGgSaVOdQocXCP4nwcs7c0DP4ywwm9zswsL5dk+IRTTU5 TVWZenhmbLVyM/jLR/MK1GFM+ X-Received: by 2002:a19:f811:: with SMTP id a17mr4794439lff.182.1579786924713; Thu, 23 Jan 2020 05:42:04 -0800 (PST) X-Received: by 2002:a19:f811:: with SMTP id a17mr4794418lff.182.1579786924504; Thu, 23 Jan 2020 05:42:04 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([85.204.121.218]) by smtp.gmail.com with ESMTPSA id w20sm1284895ljo.33.2020.01.23.05.42.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2020 05:42:03 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 2E9961800FF; Thu, 23 Jan 2020 14:42:03 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Jesper Dangaard Brouer , Amol Grover Cc: brouer@redhat.com, Alexei Starovoitov , Daniel Borkmann , "David S . Miller" , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Joel Fernandes , Madhuparna Bhowmik , "Paul E . McKenney" Subject: Re: [PATCH] bpf: devmap: Pass lockdep expression to RCU lists In-Reply-To: <20200123143725.036140e7@carbon> References: <20200123120437.26506-1-frextrite@gmail.com> <20200123143725.036140e7@carbon> X-Clacks-Overhead: GNU Terry Pratchett Date: Thu, 23 Jan 2020 14:42:03 +0100 Message-ID: <87a76e9tn8.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jesper Dangaard Brouer writes: > On Thu, 23 Jan 2020 17:34:38 +0530 > Amol Grover wrote: > >> head is traversed using hlist_for_each_entry_rcu outside an >> RCU read-side critical section but under the protection >> of dtab->index_lock. > > We do hold the lock in update and delete cases, but not in the lookup > cases. Is it then still okay to add the lockdep_is_held() annotation? I concluded 'yes' from the comment on hlist_for_each_entry_rcu(): The lockdep condition gets passed to this: #define __list_check_rcu(dummy, cond, extra...) \ ({ \ check_arg_count_one(extra); \ RCU_LOCKDEP_WARN(!cond && !rcu_read_lock_any_held(), \ "RCU-list traversed in non-reader section!"); \ }) so that seems fine :) -Toke