From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2D139EED615 for ; Thu, 12 Sep 2024 15:51:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:References:Content-Type: Content-Transfer-Encoding:In-Reply-To:From:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=t9VILr0qkYP4rvJKavSsOF6cu9G5TqXZShkha385+XA=; b=fkPIsUr0wK+jqAjy2rnUwyVkkJ iH4BKSxTVC+xhuDfGMO4/Qfrl3N31K0VHe84xxPaBVAwbq9xXYOQ1o22lX0K29Lo7KraDf9qA+p+q fOTTgPBD8DnrMQsKlUdye9LSGyrJs26V7ImhHosJ6X23cTB9JvzMaXcPPwZ3I1I8RoVyykZ/9EW1o yc6BrtyCb2QuEoL8juHYToRya7qEMCYB+ztKOI6dYptblBZispJE8aRDoZDyTK4mKHWgYcNoDsXF/ 5ScpbpeY0P9PXdR0Dlzzp/7GAEDhcMJnsNFDOeJvli8fKkcu9z7PaojFUxIEdzt0yTFECgFl0/IyI IzAEzUIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1som61-0000000DcNu-19j0; Thu, 12 Sep 2024 15:51:01 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1som5x-0000000DcNY-3nMN for linux-nvme@lists.infradead.org; Thu, 12 Sep 2024 15:51:00 +0000 Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20240912155053epoutp04d3da2de7407ddbb3ffc406c8b61a8c4e~0ifedzP7w2414624146epoutp04D for ; Thu, 12 Sep 2024 15:50:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20240912155053epoutp04d3da2de7407ddbb3ffc406c8b61a8c4e~0ifedzP7w2414624146epoutp04D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1726156253; bh=t9VILr0qkYP4rvJKavSsOF6cu9G5TqXZShkha385+XA=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=cX6fpqCdzPNuJGL7dr3izSpgxqHcAzY/DhTXjK1OxHiBa5quc3tYpqEGI6xdezVZ2 BXHbIXeZwikjN7W6ze37q0ZUHI78N30v8qxJqshW84Fsnz6WEwTAk33VP7TZXhZlSi lyvA+KcAM1vGCFWd1L4fvmW4oVgt7HHSllFSeL0I= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20240912155052epcas5p2b02dfa87f8f14aebc50237e7e689f9d1~0ifdLYGGZ0517205172epcas5p23; Thu, 12 Sep 2024 15:50:52 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.174]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4X4MNV5JVsz4x9Pp; Thu, 12 Sep 2024 15:50:50 +0000 (GMT) Received: from epcas5p1.samsung.com ( [182.195.41.39]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id A1.28.09743.ADD03E66; Fri, 13 Sep 2024 00:50:50 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20240912155049epcas5p479bf103d5407f12aeeb936b3f167e9f0~0ifazBgj10514805148epcas5p4F; Thu, 12 Sep 2024 15:50:49 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240912155049epsmtrp23139a0c48ea642236cda3a4145f6eb0e~0ifav_tYp3192931929epsmtrp2M; Thu, 12 Sep 2024 15:50:49 +0000 (GMT) X-AuditID: b6c32a4a-14fff7000000260f-37-66e30dda6919 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id EE.82.07567.9DD03E66; Fri, 13 Sep 2024 00:50:49 +0900 (KST) Received: from [107.122.11.51] (unknown [107.122.11.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240912155046epsmtip24aa2bc591086ec837e8ed050a50d5f8e~0ifX9cWQI0255602556epsmtip2G; Thu, 12 Sep 2024 15:50:46 +0000 (GMT) Message-ID: <0baddb91-b292-db90-8110-37fa5a19af01@samsung.com> Date: Thu, 12 Sep 2024 21:20:45 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v5 1/5] fs, block: refactor enum rw_hint Content-Language: en-US To: Christoph Hellwig 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 From: Kanchan Joshi In-Reply-To: <20240912125347.GA28068@lst.de> Content-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MThESSE8sSc1O TS1ILYLJMnFwSjUwHVjE7LytTphBw0U05cuv2WIPGvduCW5am75ap1vshFYge9hbk6QHzoeO +07KTUrxtclccf/DZ515itV596cYP311/XNT+K8X9WG5r6N+3zGrEjmZpJjurrxsQd3V7823 0xQ0JDwP8mhfsF2rtNyP57/+LYZTrIan1e3fzuMO4+LetK3zeDajyukFS19OrxeY1z9tpljN 7Pg4C+bJWXySx+9wZsx8Hs1wYq6ayaQ70XJ/vyZxrbSPlPtofs5h8wJ1Buvl0UJX5G77u78L vtqzICup4GJ/euUmwRWmNlMdLWRuKq/5OUl89eLfgqcKF3o5vOqR8reUfmM8ozVnzhV18d3b +3Y7v9oStWM5u94lJZbijERDLeai4kQASkYcrXIDAAA= X-CMS-MailID: 20240912155049epcas5p479bf103d5407f12aeeb936b3f167e9f0 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240910151044epcas5p37f61bb85ccf8b3eb875e77c3fc260c51 References: <20240910150200.6589-1-joshi.k@samsung.com> <20240910150200.6589-2-joshi.k@samsung.com> <20240912125347.GA28068@lst.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240912_085058_450376_624DE501 X-CRM114-Status: GOOD ( 18.90 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org 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;