Received: by 10.192.165.148 with SMTP id m20csp3940966imm; Mon, 23 Apr 2018 15:32:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx48tYwHOdMetqod52AxHwX291n3Bw1AD1+vs1MR+azcqJWD0XD6rMwmoTmEUtrl5Sgq/qJEV X-Received: by 10.99.97.139 with SMTP id v133mr17873968pgb.285.1524522735666; Mon, 23 Apr 2018 15:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524522735; cv=none; d=google.com; s=arc-20160816; b=o1j1RsKa8Yr0LV0ZXEHZrHHP6f13dhCpf6ciLR2W01cyQEIPL5f9jE5JpTxK1cFfs3 7H3dz11wBe6cGGcukpMY8RaR/MdbFAJZpVFIMtniRVER3bE/WNSBhyhaoamhduAPT9nh kFeL8mpH/6T1diKj3E7eMY3qEhjgBnWhH64r0WBdKU9WusBROte1LGnQCz307K+2rZ/V JguMVUejEajyKfCMqBxitBN/hmHacnq7y+vzlxibultXnCYJ083yx+l/0X6fSEI/qhBm 8Fk+U2EjayjxOg6lxg3airw/6Sn0ZFvqE6gSAZddeawqSjvSgk7DP4A0S2H6njYo0T3E ipZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:cc:subject:date:to :from:arc-authentication-results; bh=9YA8jBlaCb9SMhQxJHABowpDZrRKtIWigzeEW+V+gfA=; b=uDoqAZHUCtNmtaolTTbu7f1cArhwW0k3CF2ADexKjLAgnLfYkta4oybpe6toKVtGju nzrWqY13TVikqL65+wk8AJcqEuU2Ms+NhFG2Gf048D1ECqlWpvwFpcPVDpZI8eyx3WWa XXl2R4/JDMO/omSDlP4wSlkHYvbg/pRaxJIlMo6k7yp7NhBAXiUJF9UCNVapokcFw06m CEcbWO/cm1dbsnP2LhrxCSrG6bDSgIAliT9MDt5PXek4zpQd2HMGPNjMWcFtet4OFgXp 6WYo8aaW6w0PVjyEIck4VC6aMnM0mg87Fc0eYFQYfnAeCCaz4+L/PSJdCtpEW6SHKWdh JrHQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3-v6si12564562plb.536.2018.04.23.15.32.01; Mon, 23 Apr 2018 15:32:15 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932623AbeDWW34 (ORCPT + 99 others); Mon, 23 Apr 2018 18:29:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:54612 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932367AbeDWW3w (ORCPT ); Mon, 23 Apr 2018 18:29:52 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0F164AC92; Mon, 23 Apr 2018 22:29:51 +0000 (UTC) From: NeilBrown To: Thomas Graf , Herbert Xu , David Miller Date: Tue, 24 Apr 2018 08:29:13 +1000 Subject: [PATCH 2/4] rhashtable: Revise incorrect comment on r{hl, hash}table_walk_enter() Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <152452255344.1456.125137119770267098.stgit@noble> In-Reply-To: <152452244405.1456.8175298512483573078.stgit@noble> References: <152452244405.1456.8175298512483573078.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Neither rhashtable_walk_enter() or rhltable_walk_enter() sleep, though they do take a spinlock without irq protection. So revise the comments to accurately state the contexts in which these functions can be called. Acked-by: Herbert Xu Signed-off-by: NeilBrown --- include/linux/rhashtable.h | 5 +++-- lib/rhashtable.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h index 87d443a5b11d..4e1f535c2034 100644 --- a/include/linux/rhashtable.h +++ b/include/linux/rhashtable.h @@ -1268,8 +1268,9 @@ static inline int rhashtable_walk_init(struct rhashtable *ht, * For a completely stable walk you should construct your own data * structure outside the hash table. * - * This function may sleep so you must not call it from interrupt - * context or with spin locks held. + * This function may be called from any process context, including + * non-preemptable context, but cannot be called from softirq or + * hardirq context. * * You must call rhashtable_walk_exit after this function returns. */ diff --git a/lib/rhashtable.c b/lib/rhashtable.c index 2b2b79974b61..6d490f51174e 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c @@ -668,8 +668,9 @@ EXPORT_SYMBOL_GPL(rhashtable_insert_slow); * For a completely stable walk you should construct your own data * structure outside the hash table. * - * This function may sleep so you must not call it from interrupt - * context or with spin locks held. + * This function may be called from any process context, including + * non-preemptable context, but cannot be called from softirq or + * hardirq context. * * You must call rhashtable_walk_exit after this function returns. */