From: Kanchan Joshi <joshi.k@samsung.com>
To: Christoph Hellwig <hch@lst.de>
Cc: axboe@kernel.dk, kbusch@kernel.org, sagi@grimberg.me,
martin.petersen@oracle.com,
James.Bottomley@HansenPartnership.com, brauner@kernel.org,
viro@zeniv.linux.org.uk, jack@suse.cz, jaegeuk@kernel.org,
jlayton@kernel.org, chuck.lever@oracle.com, bvanassche@acm.org,
linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net,
linux-block@vger.kernel.org, linux-scsi@vger.kernel.org,
gost.dev@samsung.com, vishak.g@samsung.com,
javier.gonz@samsung.com
Subject: Re: [PATCH v5 1/5] fs, block: refactor enum rw_hint
Date: Thu, 12 Sep 2024 21:20:45 +0530 [thread overview]
Message-ID: <0baddb91-b292-db90-8110-37fa5a19af01@samsung.com> (raw)
In-Reply-To: <20240912125347.GA28068@lst.de>
On 9/12/2024 6:23 PM, Christoph Hellwig wrote:
> On Tue, Sep 10, 2024 at 08:31:56PM +0530, Kanchan Joshi wrote:
>> Rename enum rw_hint to rw_lifetime_hint.
>> Change i_write_hint (in inode), bi_write_hint(in bio), and write_hint
>> (in request) to use u8 data-type rather than this enum.
>>
>> This is in preparation to introduce a new write hint type.
>
> The rationale seems a bit sparse. Why is it renamed? Because the
> name fits better, because you need the same for something else?
>
Right, new name fits better. Because 'enum rw_hint' is a generic name
that conveys 'any' hint. This was fine before. But once we start
supporting more than one hint type, we need to be specific what
hint-type is being handled. More below.
>> static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh,
>> - enum rw_hint hint, struct writeback_control *wbc);
>> + u8 hint, struct writeback_control *wbc);
>
> And moving from the enum to an plain integer seems like a bit of a
> retrograde step.
This particular enum is hardwired to take 6 temperature-hint values [*].
But this (and many other) functions act as a simple propagator, which do
not have to care whether hint type is lifetime or placement or anything
else.
The creator/originator of the hint decides what hint to pass (userspace
in this case). And the consumer (driver in this case) decides whether or
not it understands the hint that has been passed. The intermediate
components/functions only need to pass the hint, regardless of its type,
down.
Wherever hint is being used in generic way, u8 data type is being used.
Down the line if a component/function needs to care for a specific
type, it can start decoding the passed hint type/value (using the
appropriate macro similar to what this series does for SCSI and NVMe).
Overall, this also helps to avoid the churn. Otherwise we duplicate all
the propagation code that has been done for temperature hint across the
IO stack.
[*]
enum rw_hint {
WRITE_LIFE_NOT_SET = RWH_WRITE_LIFE_NOT_SET,
WRITE_LIFE_NONE = RWH_WRITE_LIFE_NONE,
WRITE_LIFE_SHORT = RWH_WRITE_LIFE_SHORT,
WRITE_LIFE_MEDIUM = RWH_WRITE_LIFE_MEDIUM,
WRITE_LIFE_LONG = RWH_WRITE_LIFE_LONG,
WRITE_LIFE_EXTREME = RWH_WRITE_LIFE_EXTREME,
} __packed;
next prev parent reply other threads:[~2024-09-12 15:51 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20240910151040epcas5p3f47fa7ea37a35f8b44dd9174689e1bb9@epcas5p3.samsung.com>
2024-09-10 15:01 ` [PATCH v5 0/5] data placement hints and FDP Kanchan Joshi
2024-09-10 15:01 ` [PATCH v5 1/5] fs, block: refactor enum rw_hint Kanchan Joshi
2024-09-12 12:53 ` Christoph Hellwig
2024-09-12 15:50 ` Kanchan Joshi [this message]
2024-09-12 20:30 ` Bart Van Assche
2024-09-13 7:22 ` Kanchan Joshi
2024-09-10 15:01 ` [PATCH v5 2/5] fcntl: rename rw_hint_* to rw_lifetime_hint_* Kanchan Joshi
2024-09-12 12:54 ` Christoph Hellwig
2024-09-12 15:51 ` Kanchan Joshi
2024-09-10 15:01 ` [PATCH v5 3/5] fcntl: add F_{SET/GET}_RW_HINT_EX Kanchan Joshi
2024-09-10 18:48 ` Jens Axboe
2024-09-11 15:50 ` Kanchan Joshi
2024-09-12 13:01 ` Christoph Hellwig
2024-09-12 15:53 ` Kanchan Joshi
2024-09-12 20:36 ` Bart Van Assche
2024-09-13 7:15 ` Kanchan Joshi
2024-09-10 15:01 ` [PATCH v5 4/5] sd: limit to use write life hints Kanchan Joshi
2024-09-12 13:02 ` Christoph Hellwig
2024-09-12 16:31 ` Kanchan Joshi
2024-09-13 8:06 ` Christoph Hellwig
2024-09-16 13:49 ` Kanchan Joshi
2024-09-17 6:20 ` Christoph Hellwig
2024-09-17 16:03 ` Kanchan Joshi
2024-09-17 17:00 ` Kanchan Joshi
2024-09-18 6:42 ` Christoph Hellwig
2024-09-18 8:12 ` Kanchan Joshi
2024-09-18 12:01 ` Christoph Hellwig
2024-09-24 9:24 ` Kanchan Joshi
2024-09-24 9:28 ` Christoph Hellwig
2024-09-10 15:02 ` [PATCH v5 5/5] nvme: enable FDP support Kanchan Joshi
2025-01-29 0:56 ` [f2fs-dev] [PATCH v5 0/5] data placement hints and FDP patchwork-bot+f2fs
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=0baddb91-b292-db90-8110-37fa5a19af01@samsung.com \
--to=joshi.k@samsung.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=bvanassche@acm.org \
--cc=chuck.lever@oracle.com \
--cc=gost.dev@samsung.com \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--cc=jaegeuk@kernel.org \
--cc=javier.gonz@samsung.com \
--cc=jlayton@kernel.org \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sagi@grimberg.me \
--cc=viro@zeniv.linux.org.uk \
--cc=vishak.g@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox