Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2816736rwb; Wed, 30 Nov 2022 11:14:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf72grJfFS5yRxECHSs0MhvbIxHslQrSM3XEsdB1/veb3WTrR2MiFE4VnUqM9tJR/bXiSR8E X-Received: by 2002:a17:906:dfc1:b0:78d:894d:e123 with SMTP id jt1-20020a170906dfc100b0078d894de123mr2503844ejc.112.1669835643257; Wed, 30 Nov 2022 11:14:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669835643; cv=none; d=google.com; s=arc-20160816; b=tU/dUlfE87CCmu6ic90W9pH6IuE5Lo7DT6mItBCaU4ySsXMXAkabksGVtFQ5oOE3J4 lkcisAqrkdHdLbsUsadicfgDpyis5ZLvGS8RzfEyhBLf9WuZRKDsG0XcWgH+1fvLBh7f fuymN3Zo6iVFqSIwhLVzjzla+Y5LflLSCM5QV6k7/5H+PQ4WzIhvpWcuq8uuVx9U/mUp dGJZBdATrhGzMcqp3NGDolJ26Dyy/QgIPEjkaFj0Efpnibl8nO/2+jkhavr7Rd9Y453s ECM/YU636Pxt3vBlOUmwK78HIF72armBo5tn7etAb5bmicm1v3717kzWuZOuyLqWjioS fWLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=BIxkG6XtCL2NVCbpDxVt8cW3AePHIClzg7zjjJN02x4=; b=wK/UplobHL03jYXC2VkFNApuzwVfiKbFUp/Z98wKnTWNXF3Ms6z43ECotc+SnVzYaT OoWLDi6s589iowcSGoH97Sfs+eEBhPR2jJCHv10Xfv51eFQY4gCe8icjZh/YRV5zyatZ ZrG9MoJAumo0uvUeNcUCK3L7b+80lJf6CySwkFMgqSYlYAliPJjk+Xa6qWY9pCEiFs6W EY3mrIp7fEvlRMIWKH9i5lmQDItpq5z2dPF9XcDSBACyoAHKP/a3epCte4PTV+WUwEyi EeVmutRRowdwjth/yDoeRetdk9sYW08Hdjfzg4ALYMRIGlMPIKAo23E4pyTHObmWMb7b ezDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Q/3dOAiq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p10-20020aa7cc8a000000b00458bbd3a0d2si1696706edt.602.2022.11.30.11.13.43; Wed, 30 Nov 2022 11:14:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Q/3dOAiq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230460AbiK3RGW (ORCPT + 83 others); Wed, 30 Nov 2022 12:06:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231237AbiK3RFV (ORCPT ); Wed, 30 Nov 2022 12:05:21 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5271898952; Wed, 30 Nov 2022 09:00:20 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id t17so16214337pjo.3; Wed, 30 Nov 2022 09:00:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=BIxkG6XtCL2NVCbpDxVt8cW3AePHIClzg7zjjJN02x4=; b=Q/3dOAiqE9Q5eO3HZSGyjs/ByTks7JYOhT8kAQaUyA1jA/Roh0+UPHvMwX78r6t9vP 2fHZbgPk5V6Mg3w5gbmF9eqneYQxk/RPcrCPNTuLnvtRureMqD8P445/CDNcV7m8BkC4 mBd56X8blbvytvSmWPwh0zAWRh+nXH5QwmHm5AGx3b5AZ78ULpzc+eP+aiYO+4IAu5Rd djUqhsz8ZZxK4+UqWwWjBsNiWETUMNbU4mVC0g1eQhC3yKZP7U2VflU1x+HhA43N8/MO 0P1n/InMVN0/yZqRHdEmIe2TvgIO1UivZVwbWFRvnztzagPAYaBfXE4jj/DazmvQ9JxO 8VDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BIxkG6XtCL2NVCbpDxVt8cW3AePHIClzg7zjjJN02x4=; b=UCdB3hxxckY5vvWGoHpxePmaMM+xnQqLX+JedpuUUe1gLqFY57lq9iZQekf/RVl7/O VrB1Sje6WWFmeIfQpsZfeIa1eE26vsjhbgKsH6bYm7pn2lAhW5EoexiLr5BZLh4qkihc 2nSpBs3o/mYD1emP7IfHD46uKAxkiTQNkKGrWMFo75iA/5fmiqNNm3iqZ+xOSmnRtzTT aLrLrRLSXWA/z4xmQ5a9LNLZj1A1dHpz7iFAbxTJt5524ItSe5nonRwg/JClytKFQ5BT C81mIA1lCq4EMapo8MqcIGKacrh0zq1Km3w0nrbYqniq2x4n2X3Mg6OxBlVIHdBvCRyR ppOQ== X-Gm-Message-State: ANoB5plr+FXEwK8/ORF0YQTMkjPpTOs9XiozHUqe4I6QLxClinvWvp3W p7geqVk31cORaid2Goxzx70= X-Received: by 2002:a17:90a:eac2:b0:219:484:e955 with SMTP id ev2-20020a17090aeac200b002190484e955mr29911286pjb.214.1669827619269; Wed, 30 Nov 2022 09:00:19 -0800 (PST) Received: from localhost (2603-800c-1a02-1bae-a7fa-157f-969a-4cde.res6.spectrum.com. [2603:800c:1a02:1bae:a7fa:157f:969a:4cde]) by smtp.gmail.com with ESMTPSA id u11-20020a170902e80b00b0018996404dd5sm1741487plg.109.2022.11.30.09.00.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 09:00:18 -0800 (PST) Sender: Tejun Heo Date: Wed, 30 Nov 2022 07:00:17 -1000 From: Tejun Heo To: Linus Torvalds Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@kernel.org, joshdon@google.com, brho@google.com, pjt@google.com, derkling@google.com, haoluo@google.com, dvernet@meta.com, dschatzberg@meta.com, dskarlat@cs.cmu.edu, riel@surriel.com, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH 01/31] rhashtable: Allow rhashtable to be used from irq-safe contexts Message-ID: References: <20221130082313.3241517-1-tj@kernel.org> <20221130082313.3241517-2-tj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Wed, Nov 30, 2022 at 08:35:13AM -0800, Linus Torvalds wrote: > On Wed, Nov 30, 2022 at 12:23 AM Tejun Heo wrote: > > > > > > static inline void rht_lock(struct bucket_table *tbl, > > - struct rhash_lock_head __rcu **bkt) > > + struct rhash_lock_head __rcu **bkt, > > + unsigned long *flags) > > I guess it doesn't matter as long as this actually gets inlined, but > wouldn't it be better to have > > flags = rht_lock(..); > ... > rht_unlock(.., flags); > > as the calling convention? Rather than passing a pointer to the stack around. Sure thing. > That's what the native _raw_spin_lock_irqsave() interface is (even if > "spin_lock_irqsave()" itself for historical reasons uses that inline > asm-like "pass argument by reference *without* using a pointer") Yeah, it always feels kinda weird to wrap irqsave/restore due to the special reference passing. > And gaah, we should have made 'flags' be a real type long ago, but I > guess 'unsigned long' is too ingrained and traditional to change that > now. Hahaha, that's gonna be an epic patchset. Thanks. -- tejun