All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chandan Babu R <chandan.babu@oracle.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: kernel test robot <lkp@intel.com>,
	linux-xfs@vger.kernel.org, kbuild-all@lists.01.org,
	david@fromorbit.com
Subject: Re: [PATCH V4 06/16] xfs: Promote xfs_extnum_t and xfs_aextnum_t to 64 and 32-bits respectively
Date: Thu, 06 Jan 2022 12:33:25 +0530	[thread overview]
Message-ID: <87r19lwdky.fsf@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <20220105172117.GH656707@magnolia>

On 05 Jan 2022 at 22:51, Darrick J. Wong wrote:
> On Wed, Jan 05, 2022 at 07:44:23PM +0530, Chandan Babu R wrote:
>> On 05 Jan 2022 at 05:24, Darrick J. Wong wrote:
>> > On Wed, Dec 15, 2021 at 02:49:48PM +0530, Chandan Babu R wrote:
>> >> On 14 Dec 2021 at 20:45, kernel test robot wrote:
>> >> > Hi Chandan,
>> >> >
>> >> > Thank you for the patch! Yet something to improve:
>> >> >
>> >> > [auto build test ERROR on xfs-linux/for-next]
>> >> > [also build test ERROR on v5.16-rc5]
>> >> > [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]
>> >> >
>> >> > url:    https://github.com/0day-ci/linux/commits/Chandan-Babu-R/xfs-Extend-per-inode-extent-counters/20211214-164920
>> >> > base:   https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git for-next
>> >> > config: microblaze-randconfig-r016-20211214 (https://download.01.org/0day-ci/archive/20211214/202112142335.O3Nu0vQI-lkp@intel.com/config)
>> >> > compiler: microblaze-linux-gcc (GCC) 11.2.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://github.com/0day-ci/linux/commit/db28da144803c4262c0d8622d736a7d20952ef6b
>> >> >         git remote add linux-review https://github.com/0day-ci/linux
>> >> >         git fetch --no-tags linux-review Chandan-Babu-R/xfs-Extend-per-inode-extent-counters/20211214-164920
>> >> >         git checkout db28da144803c4262c0d8622d736a7d20952ef6b
>> >> >         # save the config file to linux build tree
>> >> >         mkdir build_dir
>> >> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=microblaze SHELL=/bin/bash
>> >> >
>> >> > If you fix the issue, kindly add following tag as appropriate
>> >> > Reported-by: kernel test robot <lkp@intel.com>
>> >> >
>> >> > All errors (new ones prefixed by >>):
>> >> >
>> >> >    microblaze-linux-ld: fs/xfs/libxfs/xfs_bmap.o: in function `xfs_bmap_compute_maxlevels':
>> >> >>> (.text+0x10cc0): undefined reference to `__udivdi3'
>> >> >
>> >> 
>> >> The fix for the compilation error on 32-bit systems involved invoking do_div()
>> >> instead of using the regular division operator. I will include the fix in the
>> >> next version of the patchset.
>> >
>> > So, uh, how did you resolve this in the end?
>> >
>> > 	maxblocks = roundup_64(maxleafents, minleafrecs);
>> >
>> > and
>> >
>> > 	maxblocks = roundup_64(maxblocks, minnodrecs);
>> >
>> > ?
>> 
>> I had made the following changes,
>> 
>> 	maxblocks = maxleafents + minleafrecs - 1;
>> 	do_div(maxblocks, minleafrecs);
>> 
>> and
>> 	maxblocks += minnoderecs - 1;
>> 	do_div(maxblocks, minnoderecs);
>> 
>> roundup_64() would cause maxleafents to have a value >= its previous value
>> right?

Sorry, I meant to say "The result of roundup_64(maxleafents, minleafrecs) will
be >= than maxleafents".

The original statement was,
maxblocks = (maxleafents + minleafrecs - 1) / minleafrecs;
i.e. maxblocks would contain the number of leaf blocks required to hold
maxleafents number of records.

With maxleafents = 2^48, minleafrecs = minnoderecs = 125,
"maxblocks = (maxleafents + minleafrecs - 1) / minleafrecs" would result in,
maxblocks = (2^48 + 125 - 1) / 125
          = ~2^41

>
> roundup_64 doesn't alter its parameters, if I'm not mistaken:
>
> static inline uint64_t roundup_64(uint64_t x, uint32_t y)
> {
> 	x += y - 1;
> 	do_div(x, y);
> 	return x * y;
> }
>
          
A call to roundup_64(maxleafents, minleafrecs) would result in,
x = 2^48 + 125 - 1
x = do_div((2^48 + 125 - 1), 125) = ~2^41
x = 2^41 * 125 = ~2^48

i.e. maxblocks will not have the number of required leaf blocks.

-- 
chandan

WARNING: multiple messages have this Message-ID (diff)
From: Chandan Babu R <chandan.babu@oracle.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH V4 06/16] xfs: Promote xfs_extnum_t and xfs_aextnum_t to 64 and 32-bits respectively
Date: Thu, 06 Jan 2022 12:33:25 +0530	[thread overview]
Message-ID: <87r19lwdky.fsf@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <20220105172117.GH656707@magnolia>

[-- Attachment #1: Type: text/plain, Size: 3964 bytes --]

On 05 Jan 2022 at 22:51, Darrick J. Wong wrote:
> On Wed, Jan 05, 2022 at 07:44:23PM +0530, Chandan Babu R wrote:
>> On 05 Jan 2022 at 05:24, Darrick J. Wong wrote:
>> > On Wed, Dec 15, 2021 at 02:49:48PM +0530, Chandan Babu R wrote:
>> >> On 14 Dec 2021 at 20:45, kernel test robot wrote:
>> >> > Hi Chandan,
>> >> >
>> >> > Thank you for the patch! Yet something to improve:
>> >> >
>> >> > [auto build test ERROR on xfs-linux/for-next]
>> >> > [also build test ERROR on v5.16-rc5]
>> >> > [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]
>> >> >
>> >> > url:    https://github.com/0day-ci/linux/commits/Chandan-Babu-R/xfs-Extend-per-inode-extent-counters/20211214-164920
>> >> > base:   https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git for-next
>> >> > config: microblaze-randconfig-r016-20211214 (https://download.01.org/0day-ci/archive/20211214/202112142335.O3Nu0vQI-lkp(a)intel.com/config)
>> >> > compiler: microblaze-linux-gcc (GCC) 11.2.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://github.com/0day-ci/linux/commit/db28da144803c4262c0d8622d736a7d20952ef6b
>> >> >         git remote add linux-review https://github.com/0day-ci/linux
>> >> >         git fetch --no-tags linux-review Chandan-Babu-R/xfs-Extend-per-inode-extent-counters/20211214-164920
>> >> >         git checkout db28da144803c4262c0d8622d736a7d20952ef6b
>> >> >         # save the config file to linux build tree
>> >> >         mkdir build_dir
>> >> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=microblaze SHELL=/bin/bash
>> >> >
>> >> > If you fix the issue, kindly add following tag as appropriate
>> >> > Reported-by: kernel test robot <lkp@intel.com>
>> >> >
>> >> > All errors (new ones prefixed by >>):
>> >> >
>> >> >    microblaze-linux-ld: fs/xfs/libxfs/xfs_bmap.o: in function `xfs_bmap_compute_maxlevels':
>> >> >>> (.text+0x10cc0): undefined reference to `__udivdi3'
>> >> >
>> >> 
>> >> The fix for the compilation error on 32-bit systems involved invoking do_div()
>> >> instead of using the regular division operator. I will include the fix in the
>> >> next version of the patchset.
>> >
>> > So, uh, how did you resolve this in the end?
>> >
>> > 	maxblocks = roundup_64(maxleafents, minleafrecs);
>> >
>> > and
>> >
>> > 	maxblocks = roundup_64(maxblocks, minnodrecs);
>> >
>> > ?
>> 
>> I had made the following changes,
>> 
>> 	maxblocks = maxleafents + minleafrecs - 1;
>> 	do_div(maxblocks, minleafrecs);
>> 
>> and
>> 	maxblocks += minnoderecs - 1;
>> 	do_div(maxblocks, minnoderecs);
>> 
>> roundup_64() would cause maxleafents to have a value >= its previous value
>> right?

Sorry, I meant to say "The result of roundup_64(maxleafents, minleafrecs) will
be >= than maxleafents".

The original statement was,
maxblocks = (maxleafents + minleafrecs - 1) / minleafrecs;
i.e. maxblocks would contain the number of leaf blocks required to hold
maxleafents number of records.

With maxleafents = 2^48, minleafrecs = minnoderecs = 125,
"maxblocks = (maxleafents + minleafrecs - 1) / minleafrecs" would result in,
maxblocks = (2^48 + 125 - 1) / 125
          = ~2^41

>
> roundup_64 doesn't alter its parameters, if I'm not mistaken:
>
> static inline uint64_t roundup_64(uint64_t x, uint32_t y)
> {
> 	x += y - 1;
> 	do_div(x, y);
> 	return x * y;
> }
>
          
A call to roundup_64(maxleafents, minleafrecs) would result in,
x = 2^48 + 125 - 1
x = do_div((2^48 + 125 - 1), 125) = ~2^41
x = 2^41 * 125 = ~2^48

i.e. maxblocks will not have the number of required leaf blocks.

-- 
chandan

  reply	other threads:[~2022-01-06  7:03 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14  8:45 [PATCH V4 00/16] xfs: Extend per-inode extent counters Chandan Babu R
2021-12-14  8:45 ` [PATCH V4 01/16] xfs: Move extent count limits to xfs_format.h Chandan Babu R
2022-01-04 23:28   ` Darrick J. Wong
2021-12-14  8:45 ` [PATCH V4 02/16] xfs: Introduce xfs_iext_max_nextents() helper Chandan Babu R
2022-01-04 23:30   ` Darrick J. Wong
2021-12-14  8:45 ` [PATCH V4 03/16] xfs: Use xfs_extnum_t instead of basic data types Chandan Babu R
2021-12-14  8:45 ` [PATCH V4 04/16] xfs: Introduce xfs_dfork_nextents() helper Chandan Babu R
2022-01-04 23:48   ` Darrick J. Wong
2021-12-14  8:45 ` [PATCH V4 05/16] xfs: Use basic types to define xfs_log_dinode's di_nextents and di_anextents Chandan Babu R
2022-01-04 23:50   ` Darrick J. Wong
2022-01-05 13:43     ` Chandan Babu R
2021-12-14  8:45 ` [PATCH V4 06/16] xfs: Promote xfs_extnum_t and xfs_aextnum_t to 64 and 32-bits respectively Chandan Babu R
2021-12-14 14:54   ` kernel test robot
2021-12-14 14:54     ` kernel test robot
2021-12-14 15:05   ` kernel test robot
2021-12-14 15:05     ` kernel test robot
2021-12-14 15:15   ` kernel test robot
2021-12-14 15:15     ` kernel test robot
2021-12-15  9:19     ` Chandan Babu R
2021-12-15  9:19       ` Chandan Babu R
2022-01-04 23:54       ` Darrick J. Wong
2022-01-04 23:54         ` Darrick J. Wong
2022-01-05 14:14         ` Chandan Babu R
2022-01-05 14:14           ` Chandan Babu R
2022-01-05 17:21           ` Darrick J. Wong
2022-01-05 17:21             ` Darrick J. Wong
2022-01-06  7:03             ` Chandan Babu R [this message]
2022-01-06  7:03               ` Chandan Babu R
2022-01-06 20:31               ` Darrick J. Wong
2022-01-06 20:31                 ` Darrick J. Wong
2021-12-14  8:45 ` [PATCH V4 07/16] xfs: Introduce XFS_SB_FEAT_INCOMPAT_NREXT64 and associated per-fs feature bit Chandan Babu R
2022-01-05  0:03   ` Darrick J. Wong
2021-12-14  8:45 ` [PATCH V4 08/16] xfs: Introduce XFS_FSOP_GEOM_FLAGS_NREXT64 Chandan Babu R
2022-01-05  0:05   ` Darrick J. Wong
2022-01-05 13:44     ` Chandan Babu R
2022-01-05 17:22       ` Darrick J. Wong
2021-12-14  8:45 ` [PATCH V4 09/16] xfs: Introduce XFS_DIFLAG2_NREXT64 and associated helpers Chandan Babu R
2022-01-05  0:43   ` Darrick J. Wong
2021-12-14  8:45 ` [PATCH V4 10/16] xfs: Use xfs_rfsblock_t to count maximum blocks that can be used by BMBT Chandan Babu R
2021-12-14 18:15   ` kernel test robot
2021-12-14 18:15     ` kernel test robot
2021-12-14  8:45 ` [PATCH V4 11/16] xfs: Introduce macros to represent new maximum extent counts for data/attr forks Chandan Babu R
2022-01-05  0:42   ` Darrick J. Wong
2022-01-05 13:46     ` Chandan Babu R
2021-12-14  8:45 ` [PATCH V4 12/16] xfs: Introduce per-inode 64-bit extent counters Chandan Babu R
2022-01-05  1:04   ` Darrick J. Wong
2022-01-05 13:47     ` Chandan Babu R
2021-12-14  8:45 ` [PATCH V4 13/16] xfs: Conditionally upgrade existing inodes to use " Chandan Babu R
2022-01-05  0:18   ` Darrick J. Wong
2022-01-05 13:49     ` Chandan Babu R
2021-12-14  8:45 ` [PATCH V4 14/16] xfs: Enable bulkstat ioctl to support 64-bit per-inode " Chandan Babu R
2022-01-05  0:28   ` Darrick J. Wong
2022-01-05 13:50     ` Chandan Babu R
2021-12-14  8:45 ` [PATCH V4 15/16] xfs: Add XFS_SB_FEAT_INCOMPAT_NREXT64 to the list of supported flags Chandan Babu R
2022-01-05  0:47   ` Darrick J. Wong
2021-12-14  8:45 ` [PATCH V4 16/16] xfs: Define max extent length based on on-disk format definition Chandan Babu R
2022-01-05  0:47   ` Darrick J. Wong
2022-01-05 13:51     ` Chandan Babu R

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r19lwdky.fsf@debian-BULLSEYE-live-builder-AMD64 \
    --to=chandan.babu@oracle.com \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.