[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <223acbc1-60d4-4687-8eea-5306aa44ae24@kernel.org>
Date: Thu, 31 Jul 2025 02:24:32 +0800
From: Yu Kuai <yukuai@...nel.org>
To: Jan Kara <jack@...e.cz>, Yu Kuai <yukuai1@...weicloud.com>
Cc: axboe@...nel.dk, akpm@...ux-foundation.org, yang.yang@...o.com,
dlemoal@...nel.org, ming.lei@...hat.com, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, yi.zhang@...wei.com, yangerkun@...wei.com,
johnny.chenyi@...wei.com, Omar Sandoval <osandov@...com>,
"yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH v2 1/2] lib/sbitmap: convert shallow_depth from one word
to the whole sbitmap
hi, Jan!
在 2025/7/30 21:03, Jan Kara 写道:
> I think having two APIs will be even more confusing than the current state.
> But as I wrote I think you can have API to specify shallow depth in total
> size and in sbitmap_queue_get_shallow() do:
>
> shallow_per_word = (shallow_depth << sb->shift) / sb->depth;
> rounding_index = shallow_depth - shallow_per_word * sb->depth;
>
> and allow depth shallow_per_word + 1 if current index < rounding_index and
> exactly shallow_per_word if current index >= rounding_index. This will
> still evenly distribute shallow depth among words and I don't think the
> additional overhead of the several arithmetic operations will be visible.
Yes, you're right, I did not get your idea before. Thanks for the
explanation
and the suggestion :) Will follow this idea in the next version.
Thanks
Powered by blists - more mailing lists