From patchwork Thu Aug 2 18:29:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10554041 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 67C07174A for ; Thu, 2 Aug 2018 18:29:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53F8F2C468 for ; Thu, 2 Aug 2018 18:29:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4815C2C46A; Thu, 2 Aug 2018 18:29:46 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 BF2D92C465 for ; Thu, 2 Aug 2018 18:29:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727302AbeHBUWB (ORCPT ); Thu, 2 Aug 2018 16:22:01 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:12083 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726929AbeHBUWB (ORCPT ); Thu, 2 Aug 2018 16:22:01 -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=1533234626; x=1564770626; h=from:to:cc:subject:date:message-id; bh=Ks46k+8hsOAsh7UczDFhHwbo4M3J2aSTsqZ2UjR3ac4=; b=C7EnsTW0lSJkQhGS/TSrgc9L2Lkr5p6Kt97ecMHjv+iSivSwzsgEb0o3 XYiXi5Oii6GUT6A3HhxZbKa+rx54ix03nOouDchjDGHyRsWsxhgb6lxyR ULCRMIr9gb+gRA3Z4indLstSg9wHbtZHUheAX3xHlqzJUbhM4FBkiRm+x DaRMFmIA0fZREPTgg4vXx5+UevVzyA0oKcD4iFl34fZW6x0BoJ3kXyKm9 hojRnX972mrL34JgZKbl+sHAYtPCwlkWGhz+s8J3wDNTeommqHvk/UUOq uwx8UOJVgnJO3HJfl43Ygz/W+lHoY4HWSvl6iFmkfdczwQEEREn891bVZ w==; X-IronPort-AV: E=Sophos;i="5.51,436,1526313600"; d="scan'208";a="183378923" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 03 Aug 2018 02:30:25 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 02 Aug 2018 11:18:07 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip01.wdc.com with ESMTP; 02 Aug 2018 11:29:45 -0700 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche Subject: [PATCH v3 0/9] blk-mq: Enable runtime power management Date: Thu, 2 Aug 2018 11:29:35 -0700 Message-Id: <20180802182944.14442-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.18.0 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 Hello Jens, This patch series not only enables runtime power management for blk-mq but also fixes a starvation issue in the power management code for the legacy block layer. Please consider this patch series for kernel v4.19. Thanks, Bart. Changes compared to v2: - Fixed the build for CONFIG_BLOCK=n. - Added a patch that introduces percpu_ref_read() in the percpu-counter code. - Added a patch that makes it easier to detect missing pm_runtime_get*() calls. - Addressed Jianchao's feedback including the comment about runtime overhead of switching a per-cpu counter to atomic mode. Changes compared to v1: - Moved the runtime power management code into a separate file. - Addressed Ming's feedback. Bart Van Assche (9): block: Fix a comment in a header file block: Move power management functions into new source files block: Serialize queue freezing and blk_pre_runtime_suspend() percpu-refcount: Introduce percpu_ref_read() block, scsi: Rework runtime power management block: Warn if pm_runtime_get*() has not been called block: Remove blk_pm_requeue_request() blk-mq: Insert blk_pm_{add,put}_request() calls blk-mq: Enable support for runtime power management block/Kconfig | 5 + block/Makefile | 1 + block/blk-core.c | 246 +++---------------------------- block/blk-mq-debugfs.c | 1 - block/blk-mq-sched.c | 13 +- block/blk-mq.c | 11 ++ block/blk-pm.c | 253 ++++++++++++++++++++++++++++++++ block/blk-pm.h | 35 +++++ block/elevator.c | 24 +-- drivers/scsi/scsi_pm.c | 1 + drivers/scsi/sd.c | 5 +- drivers/scsi/sr.c | 1 + drivers/scsi/ufs/ufshcd.c | 10 +- include/linux/blk-pm.h | 30 ++++ include/linux/blkdev.h | 37 +---- include/linux/percpu-refcount.h | 2 + lib/percpu-refcount.c | 29 ++++ 17 files changed, 420 insertions(+), 284 deletions(-) create mode 100644 block/blk-pm.c create mode 100644 block/blk-pm.h create mode 100644 include/linux/blk-pm.h