All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>,
	agk@redhat.com, snitzer@kernel.org, philipp.reisner@linbit.com,
	lars.ellenberg@linbit.com, christoph.boehmwalder@linbit.com,
	hch@infradead.org, djwong@kernel.org, minchan@kernel.org,
	senozhatsky@chromium.org, patches@lists.linux.dev,
	linux-block@vger.kernel.org, linux-mm@kvack.org,
	linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	dm-devel@redhat.com, drbd-dev@lists.linbit.com,
	linux-kernel@vger.kernel.org, hare@suse.de, p.raghav@samsung.com,
	da.gomez@samsung.com, kbusch@kernel.org
Subject: Re: [PATCH 3/5] iomap: simplify iomap_init() with PAGE_SECTORS
Date: Fri, 21 Apr 2023 16:36:13 -0600	[thread overview]
Message-ID: <e032f210-f8cc-6441-2481-3c5341f8e72f@kernel.dk> (raw)
In-Reply-To: <ZEMOeb9Bt60jxV+d@bombadil.infradead.org>

On 4/21/23 4:30?PM, Luis Chamberlain wrote:
> On Fri, Apr 21, 2023 at 04:24:57PM -0600, Jens Axboe wrote:
>> On 4/21/23 4:02?PM, Luis Chamberlain wrote:
>>> On Fri, Apr 21, 2023 at 09:14:00PM +0100, Matthew Wilcox wrote:
>>>> On Fri, Apr 21, 2023 at 12:58:05PM -0700, Luis Chamberlain wrote:
>>>>> Just use the PAGE_SECTORS generic define. This produces no functional
>>>>> changes. While at it use left shift to simplify this even further.
>>>>
>>>> How is FOO << 2 simpler than FOO * 4?
>>>>
>>>>> -	return bioset_init(&iomap_ioend_bioset, 4 * (PAGE_SIZE / SECTOR_SIZE),
>>>>> +	return bioset_init(&iomap_ioend_bioset, PAGE_SECTORS << 2,
>>>
>>> We could just do:
>>>
>>>
>>> -	return bioset_init(&iomap_ioend_bioset, 4 * (PAGE_SIZE / SECTOR_SIZE),
>>> +	return bioset_init(&iomap_ioend_bioset, 4 * PAGE_SECTORS,
>>>
>>> The shift just seemed optimal if we're just going to change it.
>>
>> It's going to generate the same code, but the multiplication is arguably
>> easier to read (or harder to misread).
> 
> Then let's stick with the 4 * PAGE_SECTORS. Let me know if you need another
> patch.

Just send out a v2 at some point, you've also got a number of cases
where there are superfluous parenthesis, at least in patch 4, and Willy
pointed one out in an earlier patch too. Didn't check the last one.

This will be 6.5 anyway I think, I already sent out the changes for the
6.4 merge window.

-- 
Jens Axboe


WARNING: multiple messages have this Message-ID (diff)
From: Jens Axboe <axboe@kernel.dk>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: djwong@kernel.org, philipp.reisner@linbit.com,
	linux-mm@kvack.org, dm-devel@redhat.com, agk@redhat.com,
	drbd-dev@lists.linbit.com, christoph.boehmwalder@linbit.com,
	Matthew Wilcox <willy@infradead.org>,
	hch@infradead.org, p.raghav@samsung.com,
	senozhatsky@chromium.org, snitzer@kernel.org,
	linux-block@vger.kernel.org, kbusch@kernel.org,
	da.gomez@samsung.com, linux-kernel@vger.kernel.org,
	linux-xfs@vger.kernel.org, minchan@kernel.org,
	patches@lists.linux.dev, linux-fsdevel@vger.kernel.org,
	lars.ellenberg@linbit.com
Subject: Re: [dm-devel] [PATCH 3/5] iomap: simplify iomap_init() with PAGE_SECTORS
Date: Fri, 21 Apr 2023 16:36:13 -0600	[thread overview]
Message-ID: <e032f210-f8cc-6441-2481-3c5341f8e72f@kernel.dk> (raw)
In-Reply-To: <ZEMOeb9Bt60jxV+d@bombadil.infradead.org>

On 4/21/23 4:30?PM, Luis Chamberlain wrote:
> On Fri, Apr 21, 2023 at 04:24:57PM -0600, Jens Axboe wrote:
>> On 4/21/23 4:02?PM, Luis Chamberlain wrote:
>>> On Fri, Apr 21, 2023 at 09:14:00PM +0100, Matthew Wilcox wrote:
>>>> On Fri, Apr 21, 2023 at 12:58:05PM -0700, Luis Chamberlain wrote:
>>>>> Just use the PAGE_SECTORS generic define. This produces no functional
>>>>> changes. While at it use left shift to simplify this even further.
>>>>
>>>> How is FOO << 2 simpler than FOO * 4?
>>>>
>>>>> -	return bioset_init(&iomap_ioend_bioset, 4 * (PAGE_SIZE / SECTOR_SIZE),
>>>>> +	return bioset_init(&iomap_ioend_bioset, PAGE_SECTORS << 2,
>>>
>>> We could just do:
>>>
>>>
>>> -	return bioset_init(&iomap_ioend_bioset, 4 * (PAGE_SIZE / SECTOR_SIZE),
>>> +	return bioset_init(&iomap_ioend_bioset, 4 * PAGE_SECTORS,
>>>
>>> The shift just seemed optimal if we're just going to change it.
>>
>> It's going to generate the same code, but the multiplication is arguably
>> easier to read (or harder to misread).
> 
> Then let's stick with the 4 * PAGE_SECTORS. Let me know if you need another
> patch.

Just send out a v2 at some point, you've also got a number of cases
where there are superfluous parenthesis, at least in patch 4, and Willy
pointed one out in an earlier patch too. Didn't check the last one.

This will be 6.5 anyway I think, I already sent out the changes for the
6.4 merge window.

-- 
Jens Axboe

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  reply	other threads:[~2023-04-21 22:36 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21 19:58 [PATCH 0/5] block: simplify with PAGE_SECTORS_SHIFT Luis Chamberlain
2023-04-21 19:58 ` [dm-devel] " Luis Chamberlain
2023-04-21 19:58 ` [PATCH 1/5] dm integrity: simplify by using PAGE_SECTORS_SHIFT Luis Chamberlain
2023-04-21 19:58   ` [dm-devel] " Luis Chamberlain
2023-04-21 20:15   ` Matthew Wilcox
2023-04-21 20:15     ` [dm-devel] " Matthew Wilcox
2023-04-21 19:58 ` [PATCH 2/5] drbd: use PAGE_SECTORS_SHIFT and PAGE_SECTORS Luis Chamberlain
2023-04-21 19:58   ` [dm-devel] " Luis Chamberlain
2023-04-24  8:26   ` Christoph Böhmwalder
2023-04-24  8:26     ` [dm-devel] " Christoph Böhmwalder
2023-04-21 19:58 ` [PATCH 3/5] iomap: simplify iomap_init() with PAGE_SECTORS Luis Chamberlain
2023-04-21 19:58   ` [dm-devel] " Luis Chamberlain
2023-04-21 20:14   ` Matthew Wilcox
2023-04-21 20:14     ` [dm-devel] " Matthew Wilcox
2023-04-21 22:02     ` Luis Chamberlain
2023-04-21 22:02       ` [dm-devel] " Luis Chamberlain
2023-04-21 22:24       ` Jens Axboe
2023-04-21 22:24         ` [dm-devel] " Jens Axboe
2023-04-21 22:30         ` Luis Chamberlain
2023-04-21 22:30           ` [dm-devel] " Luis Chamberlain
2023-04-21 22:36           ` Jens Axboe [this message]
2023-04-21 22:36             ` Jens Axboe
2023-04-21 22:34       ` Dave Chinner
2023-04-21 22:34         ` [dm-devel] " Dave Chinner
2023-04-24  5:55         ` Christoph Hellwig
2023-04-24  5:55           ` [dm-devel] " Christoph Hellwig
2023-04-21 19:58 ` [PATCH 4/5] dm bufio: simplify by using PAGE_SECTORS_SHIFT Luis Chamberlain
2023-04-21 19:58   ` [dm-devel] " Luis Chamberlain
2023-04-21 19:58 ` [PATCH 5/5] zram: use generic PAGE_SECTORS and PAGE_SECTORS_SHIFT Luis Chamberlain
2023-04-21 19:58   ` [dm-devel] " Luis Chamberlain
2023-04-24  2:36   ` Sergey Senozhatsky
2023-04-24  2:36     ` [dm-devel] " Sergey Senozhatsky

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=e032f210-f8cc-6441-2481-3c5341f8e72f@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=agk@redhat.com \
    --cc=christoph.boehmwalder@linbit.com \
    --cc=da.gomez@samsung.com \
    --cc=djwong@kernel.org \
    --cc=dm-devel@redhat.com \
    --cc=drbd-dev@lists.linbit.com \
    --cc=hare@suse.de \
    --cc=hch@infradead.org \
    --cc=kbusch@kernel.org \
    --cc=lars.ellenberg@linbit.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=minchan@kernel.org \
    --cc=p.raghav@samsung.com \
    --cc=patches@lists.linux.dev \
    --cc=philipp.reisner@linbit.com \
    --cc=senozhatsky@chromium.org \
    --cc=snitzer@kernel.org \
    --cc=willy@infradead.org \
    /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.