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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88256C43217 for ; Fri, 11 Mar 2022 05:32:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346305AbiCKFdI (ORCPT ); Fri, 11 Mar 2022 00:33:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234001AbiCKFdE (ORCPT ); Fri, 11 Mar 2022 00:33:04 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D9111AC287; Thu, 10 Mar 2022 21:32:00 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0BD32B82A83; Fri, 11 Mar 2022 05:31:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E1FDC340EC; Fri, 11 Mar 2022 05:31:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646976717; bh=WZxaV6Pf7jSxcq9QhrqU6a6XmApG4E+JJxhTiL/TA4o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ob5ZHIgSUc7ffS1WUTii9bnVJtzk8WPUoL3UEGmI8LA/pPfuNB7aJAOSKJzkWpSQi 6LyEO8syF9aVEj5/kWXYkHf64UtKZowR1dt+yzXVzuHt8QOILVdmvn14AWZfemWF8Z gRioblA5Yz3SMTchKuF0GTeIOFpHmvK2xP0Mt+8Racw4eelPzbjPuQLoTUM9PoLYpb lOoPGvSqe3ouw9n3e/szesfGwcLH1zHCJEA3pyUnIMcJq/RMLFZ79HFRQCQJf92kuL uu20kCmRhPJKE+nq/8Zu1kvu65ugM6zpbwbC3JAuQP+nEoBNPld58rMB3p3IbgSHYE ls+X6siohQP0A== Date: Thu, 10 Mar 2022 21:31:55 -0800 From: Eric Biggers To: Bart Van Assche Cc: "Bean Huo (beanhuo)" , Jens Axboe , "Luca Porzio (lporzio)" , Manjong Lee , "david@fromorbit.com" , "hch@lst.de" , "kbusch@kernel.org" , "linux-block@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-nvme@lists.infradead.org" , "linux-raid@vger.kernel.org" , "sagi@grimberg.me" , "song@kernel.org" , "seunghwan.hyun@samsung.com" , "sookwan7.kim@samsung.com" , "nanich.lee@samsung.com" , "woosung2.lee@samsung.com" , "yt0928.kim@samsung.com" , "junho89.kim@samsung.com" , "jisoo2146.oh@samsung.com" , Jaegeuk Kim , linux-f2fs-devel@lists.sourceforge.net Subject: Re: [EXT] Re: [PATCH 2/2] block: remove the per-bio/request write hint. Message-ID: References: <20220306231727.GP3927073@dread.disaster.area> <20220309133119.6915-1-mj0123.lee@samsung.com> <9d645cf0-1685-437a-23e4-b2a01553bba5@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9d645cf0-1685-437a-23e4-b2a01553bba5@acm.org> Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org On Thu, Mar 10, 2022 at 02:18:19PM -0800, Bart Van Assche wrote: > On 3/10/22 13:52, Bean Huo (beanhuo) wrote: > > Yes, in upstream linux and upstream android, there is no such code. But as we know, > > mobile customers have used bio->bi_write_hint in their products for years. And the > > group ID is set according to bio->bi_write_hint before passing the CDB to UFS. > > > > > > lrbp = &hba->lrb[tag]; > > WARN_ON(lrbp->cmd); > > + if(cmd->cmnd[0] == WRITE_10) > > +{ > > + cmd->cmnd[6] = (0x1f& cmd->request->bio->bi_write_hint); > > +} > > lrbp->cmd = cmd; > > lrbp->sense_bufflen = UFS_SENSE_SIZE; > > lrbp->sense_buffer = cmd->sense_buffer; > > > > I don't know why they don't push these changes to the community, maybe > > it's because changes across the file system and block layers are unacceptable to the > > block layer and FS. but for sure we should now warn them to push to the > > community as soon as possible. > > Thanks Bean for having shared this information. I think the above code sets the GROUP > NUMBER information in the WRITE(10) command and also that the following text from the > UFS specification applies to that information: > > GROUP NUMBER: Notifies the Target device that the data linked to a ContextID: > ----------------------------------------------------------------------------------------- > GROUP NUMBER Value | Function > ----------------------------------------------------------------------------------------- > 00000b | Default, no Context ID is associated with the read operation. > 00001b to 01111b (0XXXXb) | Context ID. (XXXX I from 0001b to 1111b ‐ Context ID value) > 10000b | Data has System Data characteristics > 10001b to 11111b | Reserved > ----------------------------------------------------------------------------------------- > > In case the GROUP NUMBER is set to a reserved value, the operation shall fail and a status > response of CHECK CONDITION will be returned along with the sense key set to ILLEGAL REQUEST. > > > Since there is a desire to remove the write hint information from struct bio, is there > any other information the "system data characteristics" information can be derived from? > How about e.g. deriving that information from request flags like REQ_SYNC, REQ_META and/or > REQ_IDLE? > [+Cc linux-f2fs-devel] I think the f2fs developers will need to chime in here, as it looks like f2fs uses the write hints for different data categories like hot/cold/warm. I'm not sure those can be fully represented by other bio flags. Either way, the good news is that it sounds like this "GROUP NUMBER" thing is part of the UFS standard. So whatever the best way to support it is, it can just be submitted upstream like any other standard UFS feature. Why hasn't that been done? - Eric