From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38EE132B121 for ; Wed, 19 Aug 2026 15:31:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787153511; cv=none; b=ovfXep9WpEQUMnzkKd6iDeI/gW9gePltA/AW/r6nOi9lCoXlVvrrieT2ZOzZrpCwVgr3SRdrqYpd5JtJYUAf+ZA8X/SZPOrLxuC3F5IHSDHVhmvOMfyJRGqWyo4zytn4PPRRnadry4WuttvucVHFlxe4DqrzVmD637R5VnQfJNU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787153511; c=relaxed/simple; bh=wEtLmibMy+Dm5lufVGPJ8CIutXQ38xwU3TavJ+WDQP8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=q0j9Kslop+fo4Dw4n3o6i97DUC3I0AgBrHqF+ar3qJ9O2zwySef5X6gdgNoZ+/gf3e/LT7mFRBucmBwPwp0DK+/wCP7xvIRCY+DW9lYG6ZF/pqVT/VWw575lY0/RPiwixd0BwbCQYq4LatXyhdBZfBQvWcMmSyIJWOYfMmKQRnk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Jkcns8g/; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Jkcns8g/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0E541F000E9; Wed, 19 Aug 2026 15:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787153509; bh=HNlUnXINYq5kyrdEJYlrkOnp8RTE330uTqk5CA+kSvE=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Jkcns8g/CqHuuJ3e5laquiSCvIOOIy+m041E7EkMg90+rlBhgEDd3Z/s4QeUNPWGU 7lKnx7K2jrhCBgOZTFo3FHwZ82OOI4FYvbhCNu8cJybJwXoo7h6gMJk7pI0vKMnbZH nBsYEyZdWNN1/kxjM16IIauToDeO9M72b2ZaMWYaVoAO/VRA6Y1WUZNMJ7w7C9XKHO 33sKDuQLjJYCKTVE3zHOoF5Ht8GvDvDyrR0bZ9giWwLCrS7m94JfDs7L86sLniX3gP qDYrAf3b4sa/Mjmoocew7xhG2ldtx7a80soTfgrEaTk6b83dL1g5gbdpuEQazIg3vs sCO5/j3DOMsQw== Date: Wed, 19 Aug 2026 16:31:44 +0100 From: "Lorenzo Stoakes (ARM)" To: Kiryl Shutsemau Cc: akpm@linux-foundation.org, chrisl@kernel.org, kasong@tencent.com, shikemeng@huaweicloud.com, nphamcs@gmail.com, baoquan.he@linux.dev, baohua@kernel.org, youngjun.park@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kiryl Shutsemau (Meta)" , kernel test robot Subject: Re: [PATCH] mm: include swap.h in swapops.h Message-ID: References: <20260818115026.656406-1-kirill@shutemov.name> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260818115026.656406-1-kirill@shutemov.name> On Tue, Aug 18, 2026 at 12:50:26PM +0100, Kiryl Shutsemau wrote: > From: "Kiryl Shutsemau (Meta)" > > swapops.h uses MAX_SWAPFILES_SHIFT, SWP_MIGRATION_READ and SWP_PTE_MARKER, > all of which swap.h defines, but does not include swap.h. It compiles only > where the translation unit pulled swap.h in first. leafops.h includes > swapops.h on the line above swap.h, so a file whose include list reaches > leafops.h before swap.h gets: > > In file included from include/linux/leafops.h:11: > include/linux/swapops.h:88:21: error: use of undeclared > identifier 'MAX_SWAPFILES_SHIFT' > > A header that uses a definition has to include the header that provides it. > > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-kbuild-all/202608181757.mza9RRj7-lkp@intel.com/ > Signed-off-by: Kiryl Shutsemau (Meta) Ah C headers are terrible :) I see that the common pattern is: #include #include Which is already itself quite horrible, though I suppose intent was to separate out stuff between the two and to not require that people take swapops.h necessarily. Anyway swapops.h needs to be removed, it's a left-over from the not-quite-fully-complete softleaf work (I left some of the swap entry-specific stuff alone). But when that's done by me or whoever else, the resolution should be that swapops.h is deleted with everything there that needs to be kept around moved -> leafops since swap entries are just another softleaf type. Anyway I can fix the broader issue when I get rid of swapops.h, so this LGTM as a resolution for the time being and: Reviewed-by: Lorenzo Stoakes (ARM) > --- > include/linux/swapops.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/linux/swapops.h b/include/linux/swapops.h > index 1f3ff3b93e16..e7d0d529f3e0 100644 > --- a/include/linux/swapops.h > +++ b/include/linux/swapops.h > @@ -5,6 +5,7 @@ > #include > #include > #include > +#include > > #ifdef CONFIG_MMU > > > base-commit: 33f61b12d297562321533c048e034b1fb21c1cf3 > -- > 2.54.0 > -- Cheers, Lorenzo