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 X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B918C43381 for ; Wed, 27 Feb 2019 17:18:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E88BB2183F for ; Wed, 27 Feb 2019 17:18:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729434AbfB0RSK (ORCPT ); Wed, 27 Feb 2019 12:18:10 -0500 Received: from mga11.intel.com ([192.55.52.93]:25365 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726223AbfB0RSJ (ORCPT ); Wed, 27 Feb 2019 12:18:09 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2019 09:18:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,420,1544515200"; d="scan'208";a="129819529" Received: from gklab-107-059.igk.intel.com ([10.102.107.59]) by orsmga003.jf.intel.com with ESMTP; 27 Feb 2019 09:18:07 -0800 From: Igor Konopko To: mb@lightnvm.io, javier@javigon.com, hans.holmberg@cnexlabs.com Cc: linux-block@vger.kernel.org, igor.j.konopko@intel.com Subject: [PATCH 09/13] lightnvm: pblk: Kick writer for flush requests Date: Wed, 27 Feb 2019 18:14:38 +0100 Message-Id: <20190227171442.11853-10-igor.j.konopko@intel.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190227171442.11853-1-igor.j.konopko@intel.com> References: <20190227171442.11853-1-igor.j.konopko@intel.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org In case when there is no enough sector available in rwb and there is flush request send we should kick write thread which is not a case in current implementation. This patch fixes that issue. Signed-off-by: Igor Konopko --- drivers/lightnvm/pblk-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c index 78b1eea4ab67..f48f2e77f770 100644 --- a/drivers/lightnvm/pblk-core.c +++ b/drivers/lightnvm/pblk-core.c @@ -375,8 +375,9 @@ void pblk_write_timer_fn(struct timer_list *t) void pblk_write_should_kick(struct pblk *pblk) { unsigned int secs_avail = pblk_rb_read_count(&pblk->rwb); + unsigned int secs_to_flush = pblk_rb_flush_point_count(&pblk->rwb); - if (secs_avail >= pblk->min_write_pgs_data) + if (secs_avail >= pblk->min_write_pgs_data || secs_to_flush) pblk_write_kick(pblk); } -- 2.17.1