From patchwork Fri Oct 19 11:19:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avri Altman X-Patchwork-Id: 10649049 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 53EBF112B for ; Fri, 19 Oct 2018 11:19:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F7C5287B3 for ; Fri, 19 Oct 2018 11:19:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3094128803; Fri, 19 Oct 2018 11:19:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8B6A287B3 for ; Fri, 19 Oct 2018 11:19:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726968AbeJSTZZ (ORCPT ); Fri, 19 Oct 2018 15:25:25 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:60962 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726931AbeJSTZZ (ORCPT ); Fri, 19 Oct 2018 15:25:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1539947988; x=1571483988; h=from:to:cc:subject:date:message-id; bh=1FFN9jYWhTHrNYdubbR1/q+lQPNC/4FvCXBjJmW4pow=; b=IKimFsEb0ttt2XXJryt+qH7W1oQZQlW2i/muyBGsm8Xg4pzOxg+SlDGH kUegHr6k8RH4TS+rDLDgPNKNyXqGjiIRzArYCEBgnd+XHd/1gPr0bChIB sqgdOU9hsxamk7QULQ2py8HBHkaWajSdLhprajU5gW3SXExLqdBBwOGMm KIOiFz723vn+KeuLbCI2WlWRGnISNxopRzzL+5JJEaSfpiouMCSlSjcXB c+i9ov2YWVsGBfNfCSEMbrWUZLRtvFr29x6EYAU1otrhE5T5SIPj/Sf58 WphXcPkt992RPPFQISmmO3ZjeUTLjFQbQCTsufWc6G8ySGUMlC8YK7D5h Q==; X-IronPort-AV: E=Sophos;i="5.54,399,1534780800"; d="scan'208";a="96983216" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 19 Oct 2018 19:19:47 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 19 Oct 2018 04:04:43 -0700 Received: from kfae422988.sdcorp.global.sandisk.com ([10.0.231.37]) by uls-op-cesaip01.wdc.com with ESMTP; 19 Oct 2018 04:19:46 -0700 From: Avri Altman To: Jens Axboe , linux-block@vger.kernel.org Cc: Avi Shchislowski , Alex Lemberg , Avri Altman Subject: [PATCH v2] block: Bundle together NONE and NOT_SET writehint types Date: Fri, 19 Oct 2018 14:19:37 +0300 Message-Id: <1539947977-4686-1-git-send-email-avri.altman@wdc.com> X-Mailer: git-send-email 1.9.1 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are 6 writehint types, but the size of the write_hints array in the request queue is BLK_MAX_WRITE_HINTS = 5, which causes the EXTREME type to be ignored when iterating over the hints. We only have effectively 5 hints. Bundle together NONE and NOT_SET, since they end up in the same bucket on the driver side. fixes: f793dfd3f39a (blk-mq: expose write hints through debugfs) v1->v2: Bundle together NONE and NOT_SET, instead of making the write_hints array of the request queue larger. Change the commit title accordingly. Signed-off-by: Avri Altman --- fs/fcntl.c | 2 +- include/uapi/linux/fcntl.h | 10 +++++----- tools/include/uapi/linux/fcntl.h | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/fcntl.c b/fs/fcntl.c index 4137d96..163cf5fd 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -261,7 +261,7 @@ static int f_getowner_uids(struct file *filp, unsigned long arg) static bool rw_hint_valid(enum rw_hint hint) { switch (hint) { - case RWF_WRITE_LIFE_NOT_SET: + /* RWF_WRITE_LIFE_NOT_SET = RWH_WRITE_LIFE_NONE */ case RWH_WRITE_LIFE_NONE: case RWH_WRITE_LIFE_SHORT: case RWH_WRITE_LIFE_MEDIUM: diff --git a/include/uapi/linux/fcntl.h b/include/uapi/linux/fcntl.h index 6448cdd..ff048f8 100644 --- a/include/uapi/linux/fcntl.h +++ b/include/uapi/linux/fcntl.h @@ -58,11 +58,11 @@ * used to clear any hints previously set. */ #define RWF_WRITE_LIFE_NOT_SET 0 -#define RWH_WRITE_LIFE_NONE 1 -#define RWH_WRITE_LIFE_SHORT 2 -#define RWH_WRITE_LIFE_MEDIUM 3 -#define RWH_WRITE_LIFE_LONG 4 -#define RWH_WRITE_LIFE_EXTREME 5 +#define RWH_WRITE_LIFE_NONE RWF_WRITE_LIFE_NOT_SET +#define RWH_WRITE_LIFE_SHORT 1 +#define RWH_WRITE_LIFE_MEDIUM 2 +#define RWH_WRITE_LIFE_LONG 3 +#define RWH_WRITE_LIFE_EXTREME 4 /* * Types of directory notifications that may be requested. diff --git a/tools/include/uapi/linux/fcntl.h b/tools/include/uapi/linux/fcntl.h index 6448cdd..ff048f8 100644 --- a/tools/include/uapi/linux/fcntl.h +++ b/tools/include/uapi/linux/fcntl.h @@ -58,11 +58,11 @@ * used to clear any hints previously set. */ #define RWF_WRITE_LIFE_NOT_SET 0 -#define RWH_WRITE_LIFE_NONE 1 -#define RWH_WRITE_LIFE_SHORT 2 -#define RWH_WRITE_LIFE_MEDIUM 3 -#define RWH_WRITE_LIFE_LONG 4 -#define RWH_WRITE_LIFE_EXTREME 5 +#define RWH_WRITE_LIFE_NONE RWF_WRITE_LIFE_NOT_SET +#define RWH_WRITE_LIFE_SHORT 1 +#define RWH_WRITE_LIFE_MEDIUM 2 +#define RWH_WRITE_LIFE_LONG 3 +#define RWH_WRITE_LIFE_EXTREME 4 /* * Types of directory notifications that may be requested.