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 E3AB9C38A02 for ; Mon, 31 Oct 2022 02:11:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5C55B6B0071; Sun, 30 Oct 2022 22:11:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 575696B0073; Sun, 30 Oct 2022 22:11:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 43CD66B0074; Sun, 30 Oct 2022 22:11:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 197526B0071 for ; Sun, 30 Oct 2022 22:11:26 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C516D1604FB for ; Mon, 31 Oct 2022 02:11:25 +0000 (UTC) X-FDA: 80079617730.13.1F88F3C Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by imf24.hostedemail.com (Postfix) with ESMTP id 4CA6C180007 for ; Mon, 31 Oct 2022 02:11:25 +0000 (UTC) Received: by mail-pg1-f181.google.com with SMTP id 128so9546595pga.1 for ; Sun, 30 Oct 2022 19:11:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; 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=mD54F0nwVnvCK8vmXVrPzoRuIPNIzaFzISbCkl/mHSQ=; b=LbTfaTXH/CjJ9V6kXD3yrq7QfNhiMOIV9zkLG2omDvLObKYSuL0sZauGMH3gfIoVsv iI/EvyWucpfm5m+ZpeL47wsAwXf4h1gBm9mWWpEpELOooHBcQrSFc/WQQJxzFtwtF9Dk uHkyTMyPgGVScv1KXZ51NkI1eH3Ivre08+FIY= 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:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mD54F0nwVnvCK8vmXVrPzoRuIPNIzaFzISbCkl/mHSQ=; b=fc1sovrAQb+2TvncHt/cM8Z9lQSnRzRRb9zU20NQcdxT+cI3J5Rv8gA5LglcnH0Ucx Ufc7RBp2fnblcxUhyM1UwxXS02GFiURXIySFoSR9myXpl1MJVPhAi0DPfvVIlKi9P/yl u1i7RX3Z1//2vZLIPGvkI7sI+HzZZGNzCoYErm2keTcC4FQ1UlLy6MnpXUt/3cu5+6c5 Tli8PwoAiRhd2kG3tb+xhCoQEwnLIaMZsbv7exBGVDM52OFk5KecJIwmbdtIGVQ4aEwo te6LFoVkvKR3NIBHl0nlyN3LA/XSjLNizPYjtQFcsaSHdUpYfLJUXdB+vkNzQ+3F+TdN kJxg== X-Gm-Message-State: ACrzQf0zuZS1xgExZVYsgnfcyff7Pxd7pKtAPMSFox2HLNx9azpW1xW9 4mIvq5GMQVULx6YnBRCiDBXyELDWR8qR9Q== X-Google-Smtp-Source: AMsMyM5+Q1YaR4FNDT0EBNP5ogjwI7oj7RpLFj7mPPKa8pIgmsgBPlirEiVKDlwHDR0N7c1zpBTOcw== X-Received: by 2002:aa7:81cc:0:b0:563:4e53:c08b with SMTP id c12-20020aa781cc000000b005634e53c08bmr11879285pfn.19.1667182283951; Sun, 30 Oct 2022 19:11:23 -0700 (PDT) Received: from google.com ([240f:75:7537:3187:f624:9e85:ec7a:fa29]) by smtp.gmail.com with ESMTPSA id l1-20020a17090ab70100b00212e5fe09d7sm2996438pjr.10.2022.10.30.19.11.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Oct 2022 19:11:23 -0700 (PDT) Date: Mon, 31 Oct 2022 11:11:19 +0900 From: Sergey Senozhatsky To: kernel test robot Cc: Sergey Senozhatsky , oe-kbuild-all@lists.linux.dev, Linux Memory Management List , Andrew Morton Subject: Re: [linux-next:master 3853/4127] mm/zsmalloc.c:2220:69: warning: right shift count >= width of type Message-ID: References: <202210291926.676Ue2l1-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202210291926.676Ue2l1-lkp@intel.com> ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=LbTfaTXH; spf=pass (imf24.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.215.181 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667182285; a=rsa-sha256; cv=none; b=2ADZSHKpmy84rC8g+wyr18b7H20UcHiz8BSELIlWP91ohsTY7LJl23IG16nic6QDHwZhK5 26Pix5JlLRLlKoH4NJ1IteJ/QU2jeSZaSLgZ2LApU5Cr+0gMklUyzhYa/meNBjNbQFfGCr EadL1SrX48i4IHaUdY2zHvIJLBep0eo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667182285; 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=mD54F0nwVnvCK8vmXVrPzoRuIPNIzaFzISbCkl/mHSQ=; b=S3Oq45iHjtYuvfP30DbjQdp09xZ1D4LWyngesyePnhtzcHpxJ4w6IZ+7FclboPwUMiQiUr IFsZ8qqX2VvSaL1JdP7HZ8jqTBzoEeBlQCEjD2ofbuoXcAKZmNfnWPNDjYDWQ366wcTzOL aiBhfxEeDWGSOQ6Uz+M8MTL9NZbbI2s= X-Rspam-User: Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=LbTfaTXH; spf=pass (imf24.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.215.181 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org X-Rspamd-Server: rspam07 X-Stat-Signature: ekawsi8446y167ucsrqjtg9f3weut4ar X-Rspamd-Queue-Id: 4CA6C180007 X-HE-Tag: 1667182285-467306 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: On (22/10/29 19:33), kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > head: fd8dab197cca2746e1fcd399a218eec5164726d4 > commit: 280bbecded35eea30bbb5537f4f0a8a7e0e1b784 [3853/4127] zsmalloc: turn zspage order into runtime variable > config: parisc-randconfig-r023-20221029 > compiler: hppa64-linux-gcc (GCC) 12.1.0 > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=280bbecded35eea30bbb5537f4f0a8a7e0e1b784 > git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > git fetch --no-tags linux-next master > git checkout 280bbecded35eea30bbb5537f4f0a8a7e0e1b784 > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=parisc64 SHELL=/bin/bash > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot > > All warnings (new ones prefixed by >>): > > mm/zsmalloc.c: In function 'zs_create_pool': > >> mm/zsmalloc.c:2220:69: warning: right shift count >= width of type [-Wshift-count-overflow] > 2220 | pool->min_alloc_size = (max_pages_per_zspage << PAGE_SHIFT) >> > | ^~ Haven't seen any warnings on my side. I guess the following should do the trick: --- mm/zsmalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 0bc9ed1f1a5d..181bfc66249b 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -2211,6 +2211,7 @@ struct zs_pool *zs_create_pool(const char *name, u32 max_pages_per_zspage) int i; struct zs_pool *pool; struct size_class *prev_class = NULL; + unsigned long num_pages = max_pages_per_zspage; if (WARN_ON(max_pages_per_zspage < ZS_MIN_PAGES_PER_ZSPAGE || max_pages_per_zspage > ZS_MAX_PAGES_PER_ZSPAGE)) @@ -2221,8 +2222,7 @@ struct zs_pool *zs_create_pool(const char *name, u32 max_pages_per_zspage) return NULL; /* min_alloc_size must be multiple of ZS_ALIGN */ - pool->min_alloc_size = (max_pages_per_zspage << PAGE_SHIFT) >> - OBJ_INDEX_BITS; + pool->min_alloc_size = num_pages << PAGE_SHIFT >> OBJ_INDEX_BITS; pool->min_alloc_size = max(pool->min_alloc_size, ZS_MIN_ALLOC_SIZE); pool->num_size_classes = -- 2.38.1.273.g43a17bfeac-goog