From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DAE9C3DA61 for ; Sat, 27 Jul 2024 18:17:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C762D6B0085; Sat, 27 Jul 2024 14:16:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C260F6B0088; Sat, 27 Jul 2024 14:16:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC5FC6B0089; Sat, 27 Jul 2024 14:16:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8F55E6B0085 for ; Sat, 27 Jul 2024 14:16:59 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id E90BB801AA for ; Sat, 27 Jul 2024 18:16:58 +0000 (UTC) X-FDA: 82386338916.11.0A0A6AA Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by imf03.hostedemail.com (Postfix) with ESMTP id 903BA20021 for ; Sat, 27 Jul 2024 18:16:56 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=a2fh93h6; spf=pass (imf03.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.167.43 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722104165; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=N7MXJDFanOvjXGeDbmsv4q4l8yEMA8rUdIcZkh48+uU=; b=vxrL7mWpMeXErUC1ZPsbZGrPlrtQgpdSLrpokyq+jjQspJVoUGALI8agP8H+xuP2PpH97H FuuL6QENaAISx+b4AyMz2+Irt5eaZFHb+fEcrQdL3tY7nsXsIKxTVUlcHvW3I/3I63oFji /BCUMmQw5tBZc1M0wMzAAm0BE0lrgBU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722104165; a=rsa-sha256; cv=none; b=bfGC2n8/OMlP3sH1QdktLcWhyXYzj7zaf206+bZaUtFgvn/ITa/GKpJTxsBWpIG6Ere01n TcnUlL/wYaFdz0Y6ycLvOe9oz8KYMkbiTj9t7Ij5ItPVAlIaQzRyWtn+qknNxhu75wG95+ /rlLuPoMkAsN7eIxvUJ0aCC/VJSr1Pk= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=a2fh93h6; spf=pass (imf03.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.167.43 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-52f00ad303aso3451529e87.2 for ; Sat, 27 Jul 2024 11:16:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1722104214; x=1722709014; darn=kvack.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=N7MXJDFanOvjXGeDbmsv4q4l8yEMA8rUdIcZkh48+uU=; b=a2fh93h6ek+VWtTxIOPAhyaxyLsbzldDOgG3A44IW/cYUBDMEqcWVeBLwFnY7khtDt Idq01AefK6Lr28MzSgp/LLAbOLBlP8RtO23Dr/0PxoyjCothJo7LKYv4JAk7j5Jyq9UU 4bv1+fquQZ8fxMIEKcXgJ3mMD/vXgugfLu76w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722104214; x=1722709014; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=N7MXJDFanOvjXGeDbmsv4q4l8yEMA8rUdIcZkh48+uU=; b=jzwzLGe5EgPLIT2D7zRbIx0J30DsyFODMuq/3dCYsPyQwOX8xLW8XUXE6CE7VpIqXQ oAIQfI4aseFy+GEQPd5ighe1FbYi8VLeq53KUkZWR7nDk8uCBsShbV/4l062awkynhMa LqYP3MmA6bYeHZLEdDQpr3LK5mTXunx5q6yFVFAz5mas+qImyGZZwNoPvI08jTHpuDbB /APcMng1agy/t2NLtL0aRlPgggpnurpcayHhl8CM+tC5TB7UdXmBcr0LNEWSSvFQsCtH hSdVvHgLcxhttMCliTuaZ/poBs28uXfxF95+9gVK6pkeApKu8I/brbCpyE/OyOpyUqwT VzwQ== X-Forwarded-Encrypted: i=1; AJvYcCX4RAprockAWAUBJJTopKOqMvsljRLE/i7WhYYwViPSX/aCbrivbhjUCEw7SKDmyPYmRFr6TObHHH8Weo5ICzhQDKo= X-Gm-Message-State: AOJu0YwFJOMiRMAQ54nNaLKQhsHZe4NIUEMTw4eOgekTKzg4PamYkej8 O0LvrSxWEcRww0ID646TPw54vJ0R2Ysz9fToCyT7DBcZh2U8oWzyLbIgaHE3v+2PtbEeAg/LBsy hByODVw== X-Google-Smtp-Source: AGHT+IHOWmpqLqZV6pA8T8dNE+M03QsJTURcogWKDKEnSvTiu/ohbJEo2Vff+KZeP9WE0Vpqrxj8KQ== X-Received: by 2002:ac2:4c56:0:b0:52e:9b74:120 with SMTP id 2adb3069b0e04-5309b26b690mr2641889e87.19.1722104214183; Sat, 27 Jul 2024 11:16:54 -0700 (PDT) Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com. [209.85.208.48]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7acab23f62sm306124866b.16.2024.07.27.11.16.51 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 27 Jul 2024 11:16:51 -0700 (PDT) Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5a10835487fso3979991a12.1 for ; Sat, 27 Jul 2024 11:16:51 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCV4MgcusgA+qu5oqWJHhY8qtl1JIFLHrHn1h5jdeCur/y02n6aCg6E/WlCmlqgdBvafU+SktA3+KydHp1XhxeEYOhE= X-Received: by 2002:a05:6402:2813:b0:5a3:a4d7:caf5 with SMTP id 4fb4d7f45d1cf-5b0224cf4eemr1877971a12.36.1722104210954; Sat, 27 Jul 2024 11:16:50 -0700 (PDT) MIME-Version: 1.0 References: <23bdb6fc8d884ceebeb6e8b8653b8cfe@AcuMS.aculab.com> <902a9bf3-9404-44e8-9063-03da3168146a@lucifer.local> <137646a7-7017-490d-be78-5bd5627609c3@lucifer.local> <36aa2cad-1db1-4abf-8dd2-fb20484aabc3@lucifer.local> In-Reply-To: From: Linus Torvalds Date: Sat, 27 Jul 2024 11:16:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/7] minmax: reduce compilation time To: Matthew Wilcox Cc: Lorenzo Stoakes , Jens Axboe , David Laight , "linux-kernel@vger.kernel.org" , Christoph Hellwig , Andrew Morton , Andy Shevchenko , Dan Carpenter , Arnd Bergmann , "Jason@zx2c4.com" , "pedro.falcato@gmail.com" , Mateusz Guzik , "linux-mm@kvack.org" Content-Type: text/plain; charset="UTF-8" X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 903BA20021 X-Stat-Signature: nmnqgn1xdtsjx16h41t3ttokcd671gbe X-HE-Tag: 1722104216-619781 X-HE-Meta: U2FsdGVkX19NkwiqyerjzreSpyoZ2pZu3NQNGs1cd0w4Rr3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Xk1hirxbQjdAzrmTTGIbdKTJtgIAJCki/9buJWqyV4m6U0b5B4xdxAEYBJ/42HDEDgT3NgWNr98rZraNWrXMT8PTEjoHKn280n1SsWcH22J+RTo9KSf+kpr/gNM9FuFdd9I3jZ8VYJlBtqjPT448zXh2lk2+TKEMy4mYFy+LG8yL/rDdA/wpN10M0JdUSnDWYEHaMTjgk+xsPf1+SRAcMTVhtdVyJ4UeSftYR2ud9aoOXmCL7uF4yyEFw/wy37Rd5Ye38ai3B/qdCMQhZvKRXskGLNDC+zr53n6E24JdmQovqO5ASYDwRN4q+312lLOzl92lPnn3iKKnw1wEIV+X7glnUmBMcuU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Sat, 27 Jul 2024 at 10:34, Matthew Wilcox wrote: > > In the specific case of PageLocked, that can hopefully go away fairly > soon. We only have 24 instances left in tree and five of those are > comments/docs. The ones in fs (btrfs, crypto, f2fs, ocfs2 and pipe) > should be converted to folio soon. So unlike the min/max mess, at least in this case there's some _reason_ for the long lines (ie it's not some long line because of just mindless expansion, it's a long line because it defines several helper functions intentionally in one go). End result: I don't think these are really in the same class as some of the min/max expansion issues, but: > But I have been wondering whether the way we define all the functions > around page/folio flags is sensible. Every file which includes > page-flags.h (... which is most of them ...) regenerates the macros. > You can't grep for the definition of folio_test_locked(). There's > nowhere to put kernel-doc for folio_test_locked(). Right, these things do have their own issues, and the different flag handling helper functions _used_ to be simpler than they are now. It is indeed a pain to grep for, for example, and yes, it gets included for a lot of people who simply don't need it or want it. I'm not convinced having it in a generated file would help the greppability - I certainly don't use "grep -R" any more, I use "git grep", which by definition will never see any generated files any more than it sees pre-processor output. But whether those functions should be in one core header file at all, that's clearly questionable. I wonder how inlined they need to be either, outside of the trivial cases. (And when I say "those functions", I don't mean just the pageflag ones. The folio ones largely have all the same issues - except the "page" ones have a *TON* of debugging code in them, so they expand to be much bigger) Side note: one very simple thing to do might be to short-circuit the "constant bit number" test in the bitops that the PG_##flags cases use. That's a lot of noise to select between "simple constant bit number" and "generic variable one" when we know they are all constant. Linus