Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1086698imd; Sat, 3 Nov 2018 17:42:09 -0700 (PDT) X-Google-Smtp-Source: AJdET5fPcvh7A1the8peHdJMCtm655W2vlxiOY2reZZj5dTMrecYJlrdY6a5vsj+jM4EnZnEC+00 X-Received: by 2002:a63:164d:: with SMTP id 13-v6mr15640429pgw.103.1541292129154; Sat, 03 Nov 2018 17:42:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541292129; cv=none; d=google.com; s=arc-20160816; b=YISs+Y9nRKayRKTSMnAAbu3nA5RfR5k5PFoC+2gaeYNB1rCRIE5RCbCRZ74DCl90B+ vyZpW58fOyqCNO2PGyncBEMVrasQLEFSsnMZcHM7d5yIyMldn+MMTb0ZgaeTxgf7srmd 3YnXyebOyI37kNexPE/oOv+Ii1qvJtIWZQM8drfeTEfTto9x/VFV0C/sGxkqdtZKm5NL ashzw5h5Oua/1pf9StLvn5oHk7Mv9OAVWQQ5Nwb50uLcULjIFZznF8hil+SpL5s1fjAu C1CNXP/Kk0ujDlE8u/WqIYFXGKyFOp5LorzgoEV00CZ12CKiGsJPdwTWW7IQxB2Jv12/ dEbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject; bh=T526r9DsF3aUb6LJAQJi+SW0Msv8h+re+J9GHtESZiQ=; b=GLUDrify8UTDUNBJTPzyNzbuk90U7L7vdYi076fI8hjb3DdQRsUgjZQbRk42xJ0E9R 5quwp8KQCnIsxgEeixfkJUhDMNNFbOUFvcA3rGwtna2q1Y2Flzvl3bkf27AadVVUTXpn UdbJYx6bEZkMwql3vzfyFAr4MdGX2UKR4i/vS6a9U1ypXkoZ2+zp8ssVJ5TiHyDd/Lnj sQQB/WyuZFetzCbTusC1qMV8dRjzgmrTA8fI46N7TtV3MbWZblMunUJZ0Y7wXkE2BgzA BG4IGhq6nWPFvRF9POpct+oyd+ABaj9GVh7qXPkt39ZFs78alrP367Ti+o3pRlaKaf4+ Oobg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d82-v6si26410457pfe.190.2018.11.03.17.41.39; Sat, 03 Nov 2018 17:42:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728775AbeKDJvb (ORCPT + 99 others); Sun, 4 Nov 2018 04:51:31 -0500 Received: from mx2.suse.de ([195.135.220.15]:44974 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728545AbeKDJva (ORCPT ); Sun, 4 Nov 2018 04:51:30 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 822CCAF71; Sun, 4 Nov 2018 00:38:31 +0000 (UTC) Subject: Re: [PATCH] btrfs: avoid link error with CONFIG_NO_AUTO_INLINE To: Arnd Bergmann , Chris Mason , David Sterba , Josef Bacik Cc: Gu Jinxiang , Changbin Du , Misono Tomohiro , Anand Jain , Nikolay Borisov , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <20181103153941.1881966-1-arnd@arndb.de> From: Qu Wenruo Openpgp: preference=signencrypt Autocrypt: addr=wqu@suse.de; prefer-encrypt=mutual; keydata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pXrJH1fN GSsRb+pKEKHKtL1803x71zQxCwLh+zLP1iXHVM5j8gX9zqupigQR/Cel2XPS44zWcDW8r7B0 q1eW4Jrv0x19p4P923voqn+joIAostyNTUjCeSrUdKth9jcdlam9X2DziA/DHDFfS5eq4fEv ABEBAAHCwHwEGAEIACYWIQQt33LlpaVbqJ2qQuHCPZHzoSX+qAUCWdWBrwIbDAUJA8JnAAAK CRDCPZHzoSX+qA3xB/4zS8zYh3Cbm3FllKz7+RKBw/ETBibFSKedQkbJzRlZhBc+XRwF61mi f0SXSdqKMbM1a98fEg8H5kV6GTo62BzvynVrf/FyT+zWbIVEuuZttMk2gWLIvbmWNyrQnzPl mnjK4AEvZGIt1pk+3+N/CMEfAZH5Aqnp0PaoytRZ/1vtMXNgMxlfNnb96giC3KMR6U0E+siA 4V7biIoyNoaN33t8m5FwEwd2FQDG9dAXWhG13zcm9gnk63BN3wyCQR+X5+jsfBaS4dvNzvQv h8Uq/YGjCoV1ofKYh3WKMY8avjq25nlrhzD/Nto9jHp8niwr21K//pXVA81R2qaXqGbql+zo Message-ID: <87d4e8ce-2142-9d6e-498a-c7e5b83964eb@suse.de> Date: Sun, 4 Nov 2018 08:38:24 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181103153941.1881966-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/11/3 下午11:39, Arnd Bergmann wrote: > On 32-bit ARM with gcc-8, I see a link error with the addition of the > CONFIG_NO_AUTO_INLINE option: > > fs/btrfs/super.o: In function `btrfs_statfs': > super.c:(.text+0x67b8): undefined reference to `__aeabi_uldivmod' > super.c:(.text+0x67fc): undefined reference to `__aeabi_uldivmod' > super.c:(.text+0x6858): undefined reference to `__aeabi_uldivmod' > super.c:(.text+0x6920): undefined reference to `__aeabi_uldivmod' > super.c:(.text+0x693c): undefined reference to `__aeabi_uldivmod' > fs/btrfs/super.o:super.c:(.text+0x6958): more undefined references to `__aeabi_uldivmod' follow > > So far this is the only file that shows the behavior, so I'd propose > to just work around it by marking the functions as 'static inline' > that normally get inlined here. As a workaround it looks OK, but it's definitely not the root cause. > > The reference to __aeabi_uldivmod comes from a div_u64() which has an > optimization for a constant division that uses a straight '/' operator > when the result should be known to the compiler. My interpretation is > that as we turn off inlining, gcc still expects the result to be constant > but fails to use that constant value. It looks more like a bug in div_u64() optimization. Despite this file in btrfs, did you hit the same problem for any other file? > > Cc: Changbin Du > Fixes: 943b8435c3bd ("kernel hacking: add a config option to disable compiler auto-inlining") I can't find it in the mainline kernel, is the commit hash correct? If not merged, we should still has a chance to further polish that patch. Thanks, Qu > Signed-off-by: Arnd Bergmann > --- > fs/btrfs/super.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c > index c3c1e7bee49d..b7af0b8936ad 100644 > --- a/fs/btrfs/super.c > +++ b/fs/btrfs/super.c > @@ -1922,7 +1922,7 @@ static int btrfs_remount(struct super_block *sb, int *flags, > } > > /* Used to sort the devices by max_avail(descending sort) */ > -static int btrfs_cmp_device_free_bytes(const void *dev_info1, > +static inline int btrfs_cmp_device_free_bytes(const void *dev_info1, > const void *dev_info2) > { > if (((struct btrfs_device_info *)dev_info1)->max_avail > > @@ -1951,8 +1951,8 @@ static inline void btrfs_descending_sort_devices( > * The helper to calc the free space on the devices that can be used to store > * file data. > */ > -static int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info, > - u64 *free_bytes) > +static inline int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info, > + u64 *free_bytes) > { > struct btrfs_device_info *devices_info; > struct btrfs_fs_devices *fs_devices = fs_info->fs_devices; >