Received: by 10.223.176.5 with SMTP id f5csp2034526wra; Thu, 8 Feb 2018 07:26:35 -0800 (PST) X-Google-Smtp-Source: AH8x226MkUdQNQldFShBvwyJcytb2JuOMf0+AKHyQkHuAPRWXNyrFHiQRrxq0DntsO3jHOeKYIWS X-Received: by 10.99.117.74 with SMTP id f10mr772790pgn.385.1518103594919; Thu, 08 Feb 2018 07:26:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518103594; cv=none; d=google.com; s=arc-20160816; b=WO1mIN6lOy4+b+GUJdAbxKWxD49GNmNHOhrE3iv87CbqaYBqx7dW6+cMFq4BlBJBgw iddtZ2fsxES2Z5Ih4P/2hZNTOT+AN/bhI45ir49clD97AA3wJkJtZPTTVx4uHRf0nmll 28JmAzJHgXkA4H89XfdYXLalCAcYJwd+rFjLWmUg2WVIv1gjZFQfZl6MrHV82tNbVwQ1 1KHbBVs6QCUApoMmsxbn9hpZUlghJ9pfwLvgwOwAeNqz5t/HR182jqYiRWE+Il4+XiSK oTKuRYiOyda0mtdj+4f8zjIhOActmPlR7KupioWJP5mk4gOVNBhknDHaAn4RM0/tIC2i RXpg== 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:arc-authentication-results; bh=4JU0I9O20+YklMicjStaEqttiHxBB+SyZyh1MXaZB/c=; b=nPUjxwMBD+HPX1QLQAkRQLcJ8nXKbAmhRKhwb5yMdVK2OjNsTPDgQoWUX2T1jX7Q0o Z6+FxDbiiv2NU/Sl6oC8bE8E91CWNok1DGZ+Ru1kI9Gzu37K/lUKzAgcJhiluDrkvDyH 1bHmv1MwQnNAR5Q8N94bbwgnzuV+1ciAfTbknQ2PnMHu1zwdQmf7VFueceUYCwCPq0Ng 7OVdqlo40hjb+YWQ+/8yV0Hi4D8UEGU51e4+0Q/+78FXIl9org6CZhxEzFKSd/DvTUKx rZ03G2hCLwxwtF/6YTAZ42S8znXfL/CWpWXxhxYWZjIlYQPEx8YxA6aT5IOncwIjxsR5 DgVg== 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 c2-v6si97599pli.77.2018.02.08.07.26.19; Thu, 08 Feb 2018 07:26:34 -0800 (PST) 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 S1752208AbeBHPXc (ORCPT + 99 others); Thu, 8 Feb 2018 10:23:32 -0500 Received: from mga18.intel.com ([134.134.136.126]:65426 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751786AbeBHPXb (ORCPT ); Thu, 8 Feb 2018 10:23:31 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Feb 2018 07:23:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,479,1511856000"; d="scan'208";a="18306797" Received: from unknown (HELO localhost.localdomain) ([10.232.112.44]) by fmsmga002.fm.intel.com with ESMTP; 08 Feb 2018 07:23:29 -0800 Date: Thu, 8 Feb 2018 08:27:30 -0700 From: Keith Busch To: Nitesh Shetty Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, linux-block@vger.kernel.org, axboe@fb.com, linux-nvme@lists.infradead.org, joshi.k@samsung.com Subject: Re: [PATCH] blk: optimization for classic polling Message-ID: <20180208152730.GA4906@localhost.localdomain> References: <3578876466-3733-1-git-send-email-nj.shetty@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3578876466-3733-1-git-send-email-nj.shetty@samsung.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 30, 2083 at 09:51:06AM +0530, Nitesh Shetty wrote: > This removes the dependency on interrupts to wake up task. Set task > state as TASK_RUNNING, if need_resched() returns true, > while polling for IO completion. > Earlier, polling task used to sleep, relying on interrupt to wake it up. > This made some IO take very long when interrupt-coalescing is enabled in > NVMe. > > Reference: > http://lists.infradead.org/pipermail/linux-nvme/2018-February/015435.html > Signed-off-by: Nitesh Shetty > --- > fs/block_dev.c | 16 ++++++++++++---- > fs/direct-io.c | 8 ++++++-- > fs/iomap.c | 10 +++++++--- > 3 files changed, 25 insertions(+), 9 deletions(-) I think it'd be simpler to have blk_poll set it back to running if need_resched is true rather than repeat this patter across all the callers: --- diff --git a/block/blk-mq.c b/block/blk-mq.c index df93102e2149..40285fe1c8ad 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -3164,6 +3164,7 @@ static bool __blk_mq_poll(struct blk_mq_hw_ctx *hctx, struct request *rq) cpu_relax(); } + set_current_state(TASK_RUNNING); return false; } --