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 218F8C07548 for ; Wed, 15 Nov 2023 11:15:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 70DF96B0338; Wed, 15 Nov 2023 06:15:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6BD736B0339; Wed, 15 Nov 2023 06:15:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5ABE16B033A; Wed, 15 Nov 2023 06:15:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 49D6F6B0338 for ; Wed, 15 Nov 2023 06:15:04 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 1D802A044A for ; Wed, 15 Nov 2023 11:15:04 +0000 (UTC) X-FDA: 81459931728.26.957853F Received: from mail-ua1-f50.google.com (mail-ua1-f50.google.com [209.85.222.50]) by imf14.hostedemail.com (Postfix) with ESMTP id 5A55B10000B for ; Wed, 15 Nov 2023 11:15:02 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=iskllD7q; spf=pass (imf14.hostedemail.com: domain of naresh.kamboju@linaro.org designates 209.85.222.50 as permitted sender) smtp.mailfrom=naresh.kamboju@linaro.org; dmarc=pass (policy=none) header.from=linaro.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700046902; 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=Na/qyJPpv7M2mD4KWI412UY7s6MpSD8TKED279inyuc=; b=7bFxPomnJeo9Z+cubyaLuOW07nfJOEdCw3CohoA7F6NFaVAEO8fdH1DjY0jomLDrhHIFuw uzsQbw4lEhklrCC1oxKFZ4twsKi1/iVZIcNXP85KoMcbDU5kf5cVMD4ST4uluQqtTxsFV4 00YpNK8sTO/NVcsU8JDJx5uPHga406U= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700046902; a=rsa-sha256; cv=none; b=LAGEHEyG7VpSECA7HcbzAUFIZI1L255H4Fd/XnEyc45NRHvq+XF8VATCzxcHcJ2RnvC9hx vnqI/FNkKBsvEk96IqsPSpVCpWdE/22sKlX0pYM4lexn/wpYxm/pkxyUN9UtCXIFd37yZP 4pZYVgJvNTzdPeaW2M/6TqB3U1Au8Gw= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=iskllD7q; spf=pass (imf14.hostedemail.com: domain of naresh.kamboju@linaro.org designates 209.85.222.50 as permitted sender) smtp.mailfrom=naresh.kamboju@linaro.org; dmarc=pass (policy=none) header.from=linaro.org Received: by mail-ua1-f50.google.com with SMTP id a1e0cc1a2514c-7bb2e625165so2576948241.1 for ; Wed, 15 Nov 2023 03:15:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700046901; x=1700651701; 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=Na/qyJPpv7M2mD4KWI412UY7s6MpSD8TKED279inyuc=; b=iskllD7qM+pJ7KdZPrLC5jz1lw2/nmkZvKDhvMsMBvhKo3ac+qi3dTNvbyIomfLHsk ET+0KDcvZ47kavBd9o1+WDB+AdUYErBo5XGluXEcYXjhKyjWd1wAN6jO6x45ItvNSd4D Q/6e1DLUi3ghaQrFSkbmXP1tenj3lSahCKfm3qTfbwBiQmy2ssShXnVcuYAjoORRYokW zOOV7g6NLH7+ALAeBDLPsN1s9tkJwu3dLH6pHaWDNYy3wfj6wFos+pL0HQ/F1kNPdWjQ md/MKaVNoGjys3VgU2hciSUY9Kg3BP41vmqgfJJOeJpKPSoWHsUdEHdSgmAlmtNEsWq8 t4bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700046901; x=1700651701; 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=Na/qyJPpv7M2mD4KWI412UY7s6MpSD8TKED279inyuc=; b=DNIKAgnHnvGFCSaNHtHJNDe3khD/3Sen0jjFsPaQL2k8k+uNWqc2RbaQfPxqLIqY0Y OTPJzo3HesNbaXTRRTp4w0Rgc22c6pM56vm1V5x09Acs2MGnngNkF3Dd7krFv1U+WNpU WggZVisgxGFPbBnyBxHgKCKw7Gk15s3Ij6HQeceKrh7YU+HFhlWKs9Co0sx5pOGxElvD bqNtweX66sv05b+NlW1Fv5hSZxY7mKCefqXCaBwkNbiXnJdbVxEZe7USXZldGjeEHzHR heATu4ejTlvfBo9HzUVAQRrrLI3fhhChCq45VheGgajFJ565liv1UnT/JrW2Y/lyIZep xz3w== X-Gm-Message-State: AOJu0Ywr7LEeUVOz1DE2tNAS5I1ajOJWtuA43qdJ8qBtFIdmGXo24gG/ 78gvTrayKC9D71YUHeeHHtqwShVMuHrNuu9HABc6kg== X-Google-Smtp-Source: AGHT+IFTWpi4Ff/kgs493Yi1PtmVxMEBSw015UrnpDNqrt3IXeS1C8RYEVdQRr67V4vRMJRNPFGXcdY6WD7U8DE0Wd4= X-Received: by 2002:a67:b202:0:b0:45f:8783:beaa with SMTP id b2-20020a67b202000000b0045f8783beaamr12841662vsf.12.1700046901398; Wed, 15 Nov 2023 03:15:01 -0800 (PST) MIME-Version: 1.0 References: <20231109210608.2252323-4-willy@infradead.org> <202311121240.AN8GbAbe-lkp@intel.com> <20231113091006.f9d4de1aaf7ed2f8beef07fb@linux-foundation.org> <20231113172052.GA3733520@dev-arch.thelio-3990X> In-Reply-To: <20231113172052.GA3733520@dev-arch.thelio-3990X> From: Naresh Kamboju Date: Wed, 15 Nov 2023 16:44:49 +0530 Message-ID: Subject: Re: [PATCH v2 3/7] buffer: Fix grow_buffers() for block size > PAGE_SIZE To: Nathan Chancellor Cc: Andrew Morton , kernel test robot , "Matthew Wilcox (Oracle)" , llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, Linux Memory Management List , Hannes Reinecke , Luis Chamberlain , Pankaj Raghav , linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: uqqdmqif6ugcrfdco3owrdb1pqrkeexm X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 5A55B10000B X-Rspam-User: X-HE-Tag: 1700046902-644640 X-HE-Meta: U2FsdGVkX1+kk0vIIo4VdIB+kzKEom4fsJCLDmlPbTvHk2tqFK+lAWQCxeCXPEY00anTtM2WwI9ElSlg+0FS0v1nN6hFGRct5KtS4wgSTep3sC7RHW2K6tumZUkS0zmdhNLmkq3KSOPFU+ekGMnRhElq2/iGA/zwV7PZjgh8U3tKFR1DaS34n9xVlSh1tm/fadp8fAHGnzhSwTsXN9NYSIwuojyjNDVgfPVppfnna2ytZlT9M+B6EDmOWl9WzWsmSeGcW2o8HeuxBpRvuda9ItbyCWaJ11Meg4UCsKEdP+t5he/0B1viohM0PxMHrPkgJ7hTTAUmDzKuN4/5lz1zgEwaUwj5ru1YUBNhXDodZ7AbnoxZsyUTuxdLnZU1vTYzd8Sm/+Fooo44zUYaeheRWomIAc6D3TETRof3SdbgczzkZp5sQhGnxHxwTAvyhyxqyfYKj90uwjNXW/7b4VkLDLsm/iPlRl94nmI8q7Lvk+zbEYD9ers6fmeBcYvlec8yFMPJyzrkek1y7RzxhgauyHiAMnVWOQdWisCARirQ/JfA2BGlKDq6xXx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XJ9UxLEh9nWaX4Be5hqfOppgel4je8L4eO3y1GQ= 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: Hi Nathan, On Mon, 13 Nov 2023 at 22:50, Nathan Chancellor wrote: > > On Mon, Nov 13, 2023 at 09:10:06AM -0800, Andrew Morton wrote: > > On Sun, 12 Nov 2023 12:52:00 +0800 kernel test robot wrote: > > > > > Hi Matthew, > > > > > > kernel test robot noticed the following build errors: > > > > > > [auto build test ERROR on akpm-mm/mm-everything] > > > [also build test ERROR on linus/master next-20231110] > > > [cannot apply to v6.6] > > > [If your patch is applied to the wrong git tree, kindly drop us a note. > > > And when submitting patch, we suggest to use '--base' as documented in > > > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > > > > > url: https://github.com/intel-lab-lkp/linux/commits/Matthew-Wilcox-Oracle/buffer-Return-bool-from-grow_dev_folio/20231110-051651 > > > base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything > > > patch link: https://lore.kernel.org/r/20231109210608.2252323-4-willy%40infradead.org > > > patch subject: [PATCH v2 3/7] buffer: Fix grow_buffers() for block size > PAGE_SIZE > > > config: hexagon-comet_defconfig (https://download.01.org/0day-ci/archive/20231112/202311121240.AN8GbAbe-lkp@intel.com/config) > > > compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07) > > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231112/202311121240.AN8GbAbe-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/202311121240.AN8GbAbe-lkp@intel.com/ KFT CI also have been noticing this build problem on Linux next. Reported-by: Linux Kernel Functional Testing > > > > > > All errors (new ones prefixed by >>): > > > > > > >> ld.lld: error: undefined symbol: __muloti4 > > > >>> referenced by buffer.c > > > >>> fs/buffer.o:(bdev_getblk) in archive vmlinux.a > > > >>> referenced by buffer.c > > > >>> fs/buffer.o:(bdev_getblk) in archive vmlinux.a > > > > > > > What a peculiar compiler. > > > > I assume this fixes? > > > > --- a/fs/buffer.c~buffer-fix-grow_buffers-for-block-size-page_size-fix > > +++ a/fs/buffer.c > > @@ -1099,7 +1099,7 @@ static bool grow_buffers(struct block_de > > } > > > > /* Create a folio with the proper size buffers */ > > - return grow_dev_folio(bdev, block, pos / PAGE_SIZE, size, gfp); > > + return grow_dev_folio(bdev, block, pos >> PAGE_SHIFT, size, gfp); > > } > > > > static struct buffer_head * > > _ > > > > > > No, this is not a division libcall. This seems to be related to the > types of the variables used in __builtin_mul_overflow() :/ for some odd > reason, clang generates a libcall when passing in an 'unsigned long > long' and 'unsigned int', which apparently has not been done before in > the kernel? > > https://github.com/ClangBuiltLinux/linux/issues/1958 > https://godbolt.org/z/csfGc6z6c > > A cast would work around this but that could have other implications I > am not aware of (I've done little further investigation due to LPC): Thanks for providing this fix patch. > diff --git a/fs/buffer.c b/fs/buffer.c > index 4eb44ccdc6be..d39934783743 100644 > --- a/fs/buffer.c > +++ b/fs/buffer.c > @@ -1091,7 +1091,7 @@ static bool grow_buffers(struct block_device *bdev, sector_t block, > * Check for a block which lies outside our maximum possible > * pagecache index. > */ > - if (check_mul_overflow(block, size, &pos) || pos > MAX_LFS_FILESIZE) { > + if (check_mul_overflow(block, (u64)size, &pos) || pos > MAX_LFS_FILESIZE) { > printk(KERN_ERR "%s: requested out-of-range block %llu for device %pg\n", > __func__, (unsigned long long)block, > bdev); > > Cheers, > Nathan - Naresh