From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B52C31281B for ; Wed, 18 Feb 2026 12:23:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771417386; cv=none; b=UxCuHcQq570Lu5Wxso2nEOudT2BWSxNKavj/XGGkHYtRuINgr0CSWm1ejKEV5Yv56EXWu+dFCHeubOPCguLU6OPHKvJPa+s6ZFQGeXO0ocbN83bPFFL1vlchgvZSml3Cn8lF0qwGWvhLJtbeS5ytR8FjVCN2ARcsKL4Dqt8Ybvo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771417386; c=relaxed/simple; bh=rSi/zGdLx94wonyB5Nc+KkoFxaiaTjxmDzpadVtJyR8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DQ/UitsLSXhTaCh+KonW/pMDK3aJLllSVTQ3Pzs2IQLPVyWiXBF5mqTGh6j1DWM/Qtl4cbT5igocTRgN6vqgU+dF3yueATE7p5tfo8E+gtSOvzxeFMbS/T5rRg4Sw18KDq1BvR2rutyeJ+8PxE4liuL07h4ikpT2rzIIVPJUmno= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=L9Z5Z2MQ; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="L9Z5Z2MQ" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2a8a7269547so46169185ad.0 for ; Wed, 18 Feb 2026 04:23:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771417383; x=1772022183; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=x/l1g6wqb0NZRc7ZX34WwaHpuKkAAz4lIDkW1nuJe3Y=; b=L9Z5Z2MQyUUPl0YFpd9gN6qDWq+pB/oQnbZ5/cJhIyc8lmIT+xbVHj9QRwzrjTi68/ hbaF5wFRlec2vTXhEO7iDNB56FLAGTdp8nJKlyv4qxVJhMdinUNwPhmmO0qrl0qOUEOH hDCXZ/sfGI11Q8lVW/V6XHT3BYNN0EXrwGDiQdyeK3H/ZYpnpZfeSGBls9cxZkmqkSJM c7FmZZLfuqpuc4CeHVo/YH3ZzNQ+f5Jce5TnLavfbg2VEdWCS8jChMWuDKoZNHORK6Wx yN6jiSRnnGLUjDceW/gydaZr4nyYM7yINwr58oknJtKpej/0GH8fZDDcjWbAgppZe1ug HSDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771417383; x=1772022183; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x/l1g6wqb0NZRc7ZX34WwaHpuKkAAz4lIDkW1nuJe3Y=; b=nbPwfNbh5hRwPSW0xuQTHDruRgx6ADdCMap83XcJzU4S+F3rINM9OjgnieWiq5XRTC Nj1R/Rj7Y+2mSTrHwQ8qEnkscT9ZRh1ZcRR+Fkbgw4uLnBDubur9mohFbKUxeeeKN8k6 LC2n3yYsU8iZaWn8ggV/i2neLnmy+mEtGWPknCKWxvF1NFqGdYxEqM0oDzNqyNwjpeQ7 aSu/qXfvgYUsMRRdoKSPZSCEBO2rBHsvEI1KAuEo9snlDrnLQ/taDzzesJ5O/xFp9h8+ sqC1iaKjqbZCHIudZFmHOze9n8ycMD/JrI4Q+eIPy0g7HSeBbQgj6VV34eO+o154nBTS BxwA== X-Forwarded-Encrypted: i=1; AJvYcCVshYDXypWJFtpDhgr/ewCnHZ8vkPAYpn+88ubEaYoQ0+g9LtzKL1TrmEETx9IEGjJd4ykbjuv+NuJu+dU=@vger.kernel.org X-Gm-Message-State: AOJu0YyteG6YRNPT6sXuZ/ktD9RdC/rNU7TugBNphD6e2HH0voUjUXd2 4Ql7+qxKRuoNZ2wV+JRxShKiFGASmg1Eu9OBZ5PdcX0ozY9MWDug2pgGQqDuztqI+yI= X-Gm-Gg: AZuq6aIgt0OKfri12HgYXbZbSBV6Rxb8F/T2O45hbngqLTAssf/BjGcwNaGX4dzf00o f/JjSVfwNfLYehI5Qvhx3x+GV0WskF4jRnaqAfAVlkP6E7jXqFCBDdPz0AGExDfRG5FhV9cEmo/ k/UXWHUsjDXVh1/nT1fHp2v0FMZijPewcgdzblaUDSbW8lpo+Rq4rddCJltwEAIPnSM+k0cp+yR 131loVicTWGoB1LWPT5nTBrbfGlktUKHcysuUXprPlhbkX1FSKJKDhqY4+XwqFHxPG31QY0+CxO SO+myqi6NxbvW08imJ9P5XDXbTsGJC+9nnYHbwgkY+NHUjgmSGMZdPkJuAGRTUcYTB9UWfSMY9e +bw+ODefZlDiykeHFFlS3NVOMi96oRefonelBj+ZpMorntwIQY2FZZW8nPCq713nIry+vS7wwpO AebPEGAgEI35CL35SONCLATd9XJXycjmr9vPbGlzuZsNHR4zekHKMhv50JTnM= X-Received: by 2002:a17:902:cccf:b0:2a7:5751:5b30 with SMTP id d9443c01a7336-2ab4cf4f481mr176018015ad.12.1771417383553; Wed, 18 Feb 2026 04:23:03 -0800 (PST) Received: from KASONG-MC4 ([101.32.222.185]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-358878c2a52sm1180707a91.6.2026.02.18.04.22.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Feb 2026 04:23:02 -0800 (PST) Date: Wed, 18 Feb 2026 20:22:54 +0800 From: Kairui Song To: linux-mm@kvack.org, kernel test robot Cc: Kairui Song via B4 Relay , llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, Andrew Morton , Kemeng Shi , Nhat Pham , Baoquan He , Barry Song , Johannes Weiner , David Hildenbrand , Lorenzo Stoakes , Youngjun Park , linux-kernel@vger.kernel.org, Chris Li , Kairui Song Subject: Re: [PATCH v3 09/12] mm, swap: use the swap table to track the swap count Message-ID: References: <20260218-swap-table-p3-v3-9-f4e34be021a7@tencent.com> <202602181835.58TEynxc-lkp@intel.com> 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: <202602181835.58TEynxc-lkp@intel.com> On Wed, Feb 18, 2026 at 06:40:16PM +0800, kernel test robot wrote: > Hi Kairui, > > kernel test robot noticed the following build warnings: > > [auto build test WARNING on d9982f38eb6e9a0cb6bdd1116cc87f75a1084aad] > > url: https://github.com/intel-lab-lkp/linux/commits/Kairui-Song-via-B4-Relay/mm-swap-protect-si-swap_file-properly-and-use-as-a-mount-indicator/20260218-040852 > base: d9982f38eb6e9a0cb6bdd1116cc87f75a1084aad > patch link: https://lore.kernel.org/r/20260218-swap-table-p3-v3-9-f4e34be021a7%40tencent.com > patch subject: [PATCH v3 09/12] mm, swap: use the swap table to track the swap count > config: i386-buildonly-randconfig-001-20260218 (https://download.01.org/0day-ci/archive/20260218/202602181835.58TEynxc-lkp@intel.com/config) > compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260218/202602181835.58TEynxc-lkp@intel.com/reproduce) > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot > | Closes: https://lore.kernel.org/oe-kbuild-all/202602181835.58TEynxc-lkp@intel.com/ > > All warnings (new ones prefixed by >>): > > >> mm/swapfile.c:1627:6: warning: shift count >= width of type [-Wshift-count-overflow] > 1626 | VM_WARN_ON_ONCE(ci->extend_table[ci_off] >= > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 1627 | (BIT(BITS_PER_TYPE(ci->extend_table[0]))) - 1); > | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/vdso/bits.h:7:26: note: expanded from macro 'BIT' > 7 | #define BIT(nr) (UL(1) << (nr)) > | ^ > include/linux/mmdebug.h:123:50: note: expanded from macro 'VM_WARN_ON_ONCE' > 123 | #define VM_WARN_ON_ONCE(cond) (void)WARN_ON_ONCE(cond) > | ~~~~~~~~~~~~~^~~~~ > include/asm-generic/bug.h:120:25: note: expanded from macro 'WARN_ON_ONCE' > 120 | int __ret_warn_on = !!(condition); \ > | ^~~~~~~~~ > 1 warning generated. Nice catch from the bot. It's a new added sanity check in V3 just in case the swap count maybe grow larger than UINT_MAX, which should never happen, but just in case. I really should just use the existing helper macro for that: diff --git a/mm/swapfile.c b/mm/swapfile.c index 801d8092be51..34b38255f72a 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -1624,7 +1624,7 @@ static int __swap_cluster_dup_entry(struct swap_cluster_info *ci, } } else if (count == SWP_TB_COUNT_MAX) { VM_WARN_ON_ONCE(ci->extend_table[ci_off] >= - (BIT(BITS_PER_TYPE(ci->extend_table[0]))) - 1); + type_max(typeof(ci->extend_table[0]))); ++ci->extend_table[ci_off]; } else { /* Never happens unless counting went wrong */