From patchwork Thu Jun 15 16:42:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9789283 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8215D60384 for ; Thu, 15 Jun 2017 16:42:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7542A284F5 for ; Thu, 15 Jun 2017 16:42:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69EAB286C4; Thu, 15 Jun 2017 16:42:33 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 0DEFD286C0 for ; Thu, 15 Jun 2017 16:42:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751773AbdFOQmb (ORCPT ); Thu, 15 Jun 2017 12:42:31 -0400 Received: from mail-io0-f178.google.com ([209.85.223.178]:36058 "EHLO mail-io0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751803AbdFOQm0 (ORCPT ); Thu, 15 Jun 2017 12:42:26 -0400 Received: by mail-io0-f178.google.com with SMTP id y77so15429382ioe.3 for ; Thu, 15 Jun 2017 09:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Q/MuY6mpAAH45lCwY2+yiKnx6JT5qZiqarBRwpcNiM4=; b=wJ3xd61YAQVU+jFLpDfTT+momncs8oPLLAbOeFpaBJzDhCXrYvuG+DcVaZnEn+ga10 SSUtat34N8DqMv6mvCI3UR66+qTTAstsRXEMoRP/kKcUN3xDCMgYIjfsXiMD8JKSJNjF t3PHIrOjWxgJqNXYE+J/Iq9GoyitB9rfcc8s/2/iI3WW8VgLyW5UoZSz1iHa+WDjo8X3 jBYCqiTt9l0e+F26jyWENP454WI62GWvo1+lSeMZIQkC7DPNjaQ75YnMTxlpFy1jjSsO WiG3ObuSYu6QwDTCOyND4EIgJPBBgD0BBCoUbNymTXJEAEaxADFVOhmxG06OnBo/PuEh WEdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Q/MuY6mpAAH45lCwY2+yiKnx6JT5qZiqarBRwpcNiM4=; b=jN7gS3cBI5MF4pP93nyiPmZQGfHDooHBpGvEptmxA2hfOzgD/c+6PvIqjhsE4cEF7W SN+jHxuD48SDy2KjNiop6YFu4u2twbC8MxY2VROf3mvCsUE3g8/W98dT+k3QGqxaA1i6 wSbdtbwQYOQ7paD9Wi3i6O80zoSqIIVTsIeIqcJxR0Wdo5KROD1+5VHsLoeSVq20EY10 0dJePPIu5Xn01LniA2CdenleMGcfs0MGQF+wZYkWUIem2azncfUvjGdlRLG7LP1eXmPO kCE/PWRiNwU/8ZCDF992xiS4VReaVQJ9WVdiLRxXIJu1f69Q6nJ3p0MJ6QfMat0i7Kzm rYTA== X-Gm-Message-State: AKS2vOyN7TX/dJqlcqrURawHxhl0peqTI0nxALDoWiTE9J451fP3qkT0 F3jqXaD5f+GvwAF52wVqdA== X-Received: by 10.107.16.81 with SMTP id y78mr5947287ioi.226.1497544945141; Thu, 15 Jun 2017 09:42:25 -0700 (PDT) Received: from localhost.localdomain ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id 97sm313476iot.25.2017.06.15.09.42.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Jun 2017 09:42:24 -0700 (PDT) From: Jens Axboe To: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org Cc: adilger@dilger.ca, hch@infradead.org, martin.petersen@oracle.com, Jens Axboe Subject: [PATCH 08/12] fs: add support for buffered writeback to pass down write hints Date: Thu, 15 Jun 2017 10:42:06 -0600 Message-Id: <1497544930-19174-9-git-send-email-axboe@kernel.dk> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497544930-19174-1-git-send-email-axboe@kernel.dk> References: <1497544930-19174-1-git-send-email-axboe@kernel.dk> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Reviewed-by: Andreas Dilger Signed-off-by: Jens Axboe --- fs/buffer.c | 14 +++++++++----- fs/mpage.c | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 161be58c5cb0..3faf73a71d4b 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -49,7 +49,7 @@ static int fsync_buffers_list(spinlock_t *lock, struct list_head *list); static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, - struct writeback_control *wbc); + unsigned int stream, struct writeback_control *wbc); #define BH_ENTRY(list) list_entry((list), struct buffer_head, b_assoc_buffers) @@ -1829,7 +1829,8 @@ int __block_write_full_page(struct inode *inode, struct page *page, do { struct buffer_head *next = bh->b_this_page; if (buffer_async_write(bh)) { - submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, wbc); + submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, + inode_write_hint(inode), wbc); nr_underway++; } bh = next; @@ -1883,7 +1884,8 @@ int __block_write_full_page(struct inode *inode, struct page *page, struct buffer_head *next = bh->b_this_page; if (buffer_async_write(bh)) { clear_buffer_dirty(bh); - submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, wbc); + submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, + inode_write_hint(inode), wbc); nr_underway++; } bh = next; @@ -3091,7 +3093,7 @@ void guard_bio_eod(int op, struct bio *bio) } static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, - struct writeback_control *wbc) + unsigned int write_hint, struct writeback_control *wbc) { struct bio *bio; @@ -3134,6 +3136,8 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, op_flags |= REQ_META; if (buffer_prio(bh)) op_flags |= REQ_PRIO; + + op_flags |= bio_op_write_hint(write_hint); bio_set_op_attrs(bio, op, op_flags); submit_bio(bio); @@ -3142,7 +3146,7 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, int submit_bh(int op, int op_flags, struct buffer_head *bh) { - return submit_bh_wbc(op, op_flags, bh, NULL); + return submit_bh_wbc(op, op_flags, bh, 0, NULL); } EXPORT_SYMBOL(submit_bh); diff --git a/fs/mpage.c b/fs/mpage.c index baff8f820c29..df0635c8a512 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -614,6 +614,7 @@ static int __mpage_writepage(struct page *page, struct writeback_control *wbc, goto confused; wbc_init_bio(wbc, bio); + bio->bi_opf |= bio_op_write_hint(inode_write_hint(inode)); } /*