Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2563778pxa; Mon, 17 Aug 2020 12:52:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGyYo9AcKb9ojrLZk8PpGBWHIr4fZ33WB0yGYb5RkJkqOTmr/GZyxMASpX98DSuGXAw0DC X-Received: by 2002:a17:906:2796:: with SMTP id j22mr17708927ejc.532.1597693953446; Mon, 17 Aug 2020 12:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597693953; cv=none; d=google.com; s=arc-20160816; b=HFUOSjK68vvTqoVgN8xU1mEaPS9ovd4kjY6K4Vl8fc+bhStnRxygNkvPgEAGPFlZlk Ji3hdZ8X/KqFzFOMyLBLbpU2BK2QbHJCFQ3VH6CuCzJQaHVDu2wE5enCQQjw2emtquAh 6WgIuMc9g3o1NAKkFudvrTauDwCoBw2Azu91VURsKNlrU9Mcq3EU3Elflsh8l7G29nyx X3DzIB0Nj5kXqG8jDRsDAkyV5sv8O3OdWmmYZJ1QkBUkwydVTMYt0uvyIStsOFIsdjLD 32VucGzVs8dogmGZjuM6mBrXcNcRqsAub1Vi3pVnEantTsLyNieyZ9c5YQQeRYNSRfBM Vx5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=W/QCwiSnTEO13wgX75lDPlG5RmKP/R2S9uafXZLpRO0=; b=za87w+HvMRdGj/hlv5KnOSZVy5VgsBA27WEIRQEZf7ZkwSY2ZiLfl6C5Uhatz4I7Eg bYqi4ifQZBHIt8ouydIsGG5+x41is+VjJOiIVD+ym5kyybsfDPrkMUL2OiNWet+osxyK loDGcYUCFAzicmTDdoe9wvP6GZQ2PPcgweWhwKt8DKm1AXVx8aMsHSEBYeeMw3riaCkc g/+pUV/3NkswTKmiN7GNLkPJgoSv5QruKbfSaDYBdrlyatv1BwYLVhZcVt2zAj6Lqjuc X2LGYsuZuOVHFOSoVwFL/cPoB/+B7UWCdQ/BvE63ul09bidyU1VGu5mnNpwrGUFM7sHE OclQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UZMS8z7l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d24si12003279edz.145.2020.08.17.12.52.10; Mon, 17 Aug 2020 12:52:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UZMS8z7l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732585AbgHQTtD (ORCPT + 99 others); Mon, 17 Aug 2020 15:49:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732761AbgHQTsg (ORCPT ); Mon, 17 Aug 2020 15:48:36 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4565C061349 for ; Mon, 17 Aug 2020 12:48:36 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id i92so8323330pje.0 for ; Mon, 17 Aug 2020 12:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=W/QCwiSnTEO13wgX75lDPlG5RmKP/R2S9uafXZLpRO0=; b=UZMS8z7lBaBA4LaD7Ohc3gxbh3X0rGAieTpTrrDzaTy+L/gk/lug1xgLnT6Smuoqgy CHwvwC1+iVsaCi7JVANoAoODFUU1FJ8zXIuuSAZC1c3zP9Ppej9evmz4cKmc9teJMKuJ YXU186IAT+sMfmef2ecFE4SzXZGPKU6LCfYIk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=W/QCwiSnTEO13wgX75lDPlG5RmKP/R2S9uafXZLpRO0=; b=Zo+TgXqgfPzz9ZARPbys0jsQXFIYGDl/V8xUkn4GKa6wdXnO83JKg+xBSMBNI1mwU6 J317K1KrY/NudqdtbUz7oJebHANzmhcllwuO3ta+QcjhJH8pXhjxRKbGmD3A8i9lo1mS pyq+nKLQlwMXU8xRc0C0fwEAsFJ+ikm47rBk/koz9aDZUktN2QBSqmYNHoc+YdxYsI9u 9SwZWwU89VNFoooOuapzQZYJumF5DnZh/4+yMuMi+2TEOpkmIDUhjQaMXyfwsQU6R7Vs Jj4AFXssiHZUvDHOn9rAdFpiq2YBt4WzapyMwi6lOrNbzftNKHDL+NYvJL7ZEYFQasH0 Uwxw== X-Gm-Message-State: AOAM533ezQlm0ZWW4rdhA1zoTowMc9gbpr2o2RbgZfcY67EMZaroO6tc qN46NLqg29lxzmBhayOg5l0jXg== X-Received: by 2002:a17:902:246:: with SMTP id 64mr12417474plc.70.1597693716088; Mon, 17 Aug 2020 12:48:36 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id s8sm21663342pfc.122.2020.08.17.12.48.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 12:48:35 -0700 (PDT) Date: Mon, 17 Aug 2020 12:48:34 -0700 From: Kees Cook To: Jens Axboe Cc: Allen Pais , jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com, 3chas3@gmail.com, stefanr@s5r6.in-berlin.de, airlied@linux.ie, daniel@ffwll.ch, sre@kernel.org, James.Bottomley@HansenPartnership.com, kys@microsoft.com, deller@gmx.de, dmitry.torokhov@gmail.com, jassisinghbrar@gmail.com, shawnguo@kernel.org, s.hauer@pengutronix.de, maximlevitsky@gmail.com, oakad@yahoo.com, ulf.hansson@linaro.org, mporter@kernel.crashing.org, alex.bou9@gmail.com, broonie@kernel.org, martyn@welchs.me.uk, manohar.vanga@gmail.com, mitch@sfgoth.com, davem@davemloft.net, kuba@kernel.org, linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org, openipmi-developer@lists.sourceforge.net, linux1394-devel@lists.sourceforge.net, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-hyperv@vger.kernel.org, linux-parisc@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-ntb@googlegroups.com, linux-s390@vger.kernel.org, linux-spi@vger.kernel.org, devel@driverdev.osuosl.org, Allen Pais , Romain Perier Subject: Re: [PATCH] block: convert tasklets to use new tasklet_setup() API Message-ID: <202008171246.80287CDCA@keescook> References: <20200817091617.28119-1-allen.cryptic@gmail.com> <20200817091617.28119-2-allen.cryptic@gmail.com> <202008171228.29E6B3BB@keescook> <161b75f1-4e88-dcdf-42e8-b22504d7525c@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <161b75f1-4e88-dcdf-42e8-b22504d7525c@kernel.dk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 17, 2020 at 12:44:34PM -0700, Jens Axboe wrote: > On 8/17/20 12:29 PM, Kees Cook wrote: > > On Mon, Aug 17, 2020 at 06:56:47AM -0700, Jens Axboe wrote: > >> On 8/17/20 2:15 AM, Allen Pais wrote: > >>> From: Allen Pais > >>> > >>> In preparation for unconditionally passing the > >>> struct tasklet_struct pointer to all tasklet > >>> callbacks, switch to using the new tasklet_setup() > >>> and from_tasklet() to pass the tasklet pointer explicitly. > >> > >> Who came up with the idea to add a macro 'from_tasklet' that is just > >> container_of? container_of in the code would be _much_ more readable, > >> and not leave anyone guessing wtf from_tasklet is doing. > >> > >> I'd fix that up now before everything else goes in... > > > > As I mentioned in the other thread, I think this makes things much more > > readable. It's the same thing that the timer_struct conversion did > > (added a container_of wrapper) to avoid the ever-repeating use of > > typeof(), long lines, etc. > > But then it should use a generic name, instead of each sub-system using > some random name that makes people look up exactly what it does. I'm not > huge fan of the container_of() redundancy, but adding private variants > of this doesn't seem like the best way forward. Let's have a generic > helper that does this, and use it everywhere. I'm open to suggestions, but as things stand, these kinds of treewide changes end up getting whole-release delays because of the need to have the API in place for everyone before patches to do the changes can be sent to multiple maintainers, etc. -- Kees Cook