Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1079558yba; Sun, 31 Mar 2019 22:09:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1d+bs1ap6vTVw7Vhv0KBXD/lDkSDMMzSBHbT/lx55gvIMNfsdJCnqlYLIUyILzQIyflRj X-Received: by 2002:a62:174c:: with SMTP id 73mr60663159pfx.33.1554095359590; Sun, 31 Mar 2019 22:09:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554095359; cv=none; d=google.com; s=arc-20160816; b=PCuNTl5ZfH+9Ils2j9TMxiFTJxOqWhTiA/RAsGHic/UwdcE2sMtBhfQ2bYCoX9F+MH 97a4GNJpggJKLVr6cu0TBvE0ezNaAZPGajlMJrjd8oFFXaiZjs5LnNMhXdvnlwAAGkqZ yj0h3ksguJbMhm4tBBVNJ8qLsaEGwyEGRYTv5ml1T2jS+3/3PCPrCb9SQPGkd3cmc0MT aky4XOonfAx9fsWVZnHO7XerkBd/h7n1AJA8k/i01V8PUAI3Q0kqGOsca26+sy+DB1yi lrqaBlGi+m4mhFxvSQOIINPa6sDUXwOiGd1JuTI6UAx3uQC69avS8f2o53WJaXEIVuny z6Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=1Qsm07q5AbgmTCPoOSgjEwagjAL4cTN+I+4j1A2XV4k=; b=qOwtOhmm+B4p7hOLIfhNt7suuOIuIbUNfHEZ8SHD9ac7z16f7iIS62F00nnfbiffiH 2fffqhSyiQ3WreaRZqD49AnF3cxFdR+nAWM+mkzYEtyutCIyyNOXAZN/Z6bOOawg/lPD 1Kzf44Gq8YhzZH8wJpLM0chDlgLFvjW2Vkud4fJven9au/1TsjbJJOL27sj13j+LBSHY nKA4Z1HuUuv1rk7sfdeiJPq6I8JBDTupChpc6CHA2poO3a9EjXI26ovoASDXIGGU4vZw oHmHyeWhN5VJngPG5ZBgeirrFZHSSQ18kwQDQzvhLarIGNPWjvS6nTIO031K44N7S4uW 1ung== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p22si8313811pgi.449.2019.03.31.22.09.04; Sun, 31 Mar 2019 22:09:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731111AbfDAFI0 (ORCPT + 99 others); Mon, 1 Apr 2019 01:08:26 -0400 Received: from ipmail03.adl6.internode.on.net ([150.101.137.143]:29795 "EHLO ipmail03.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725784AbfDAFI0 (ORCPT ); Mon, 1 Apr 2019 01:08:26 -0400 Received: from ppp59-167-129-252.static.internode.on.net (HELO dastard) ([59.167.129.252]) by ipmail03.adl6.internode.on.net with ESMTP; 01 Apr 2019 15:38:23 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1hApBF-0004N7-IS; Mon, 01 Apr 2019 16:08:21 +1100 Date: Mon, 1 Apr 2019 16:08:21 +1100 From: Dave Chinner To: Kanchan Joshi Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, axboe@fb.com, prakash.v@samsung.com, anshul@samsung.com, joshiiitr@gmail.com Subject: Re: [PATCH v3 3/7] block: add write-hint to stream-id conversion Message-ID: <20190401050821.GQ23020@dastard> References: <1553846032-4451-1-git-send-email-joshi.k@samsung.com> <1553846032-4451-4-git-send-email-joshi.k@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1553846032-4451-4-git-send-email-joshi.k@samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 29, 2019 at 01:23:48PM +0530, Kanchan Joshi wrote: > Earlier this conversion was done by driver (nvme). Current conversion > is of the form "streamid = write-hint - 1", for both user and kernel > streams (note that existing infra takes care that user-streams do not > bump into kernel ones). Unless we add new user streams, then all the kernel streams change ID. I'll deal with this in more detail in a later patch. > Conversion takes stream limit (maintained in > request queue) into account. Write-hints beyond the queue-limit turn > to 0. > New field 'streamid' has been added in request. While 'write-hint' field > continues to exist. It keeps original value passed from upper layer, and > used during merging checks. > > Signed-off-by: Kanchan Joshi > --- > block/blk-core.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/block/blk-core.c b/block/blk-core.c > index 3c5f61c..c86daed 100644 > --- a/block/blk-core.c > +++ b/block/blk-core.c > @@ -727,6 +727,25 @@ bool blk_attempt_plug_merge(struct request_queue *q, struct bio *bio, > return false; > } > > +enum rw_hint blk_write_hint_to_streamid(struct request *req, > + struct bio *bio) > +{ > + enum rw_hint streamid, nr_streams; > + struct request_queue *q = req->q; > + nr_streams = q->limits.nr_streams; > + > + streamid = bio->bi_write_hint; > + if (!nr_streams || streamid == WRITE_LIFE_NOT_SET || > + streamid == WRITE_LIFE_NONE) > + streamid = 0; > + else { > + --streamid; What's this magic thing do? > + if(streamid > nr_streams) > + streamid = 0; So, basically, we'll compress all the kernel hints down to "no hint" if there are more user streams than the device supports? Surely we should be reserving a stream for the kernel hints separate from the user and "none" streams when we have limited device streams available... Cheers, Dave. -- Dave Chinner david@fromorbit.com