From patchwork Thu Aug 23 16:26:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 10574317 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 0252F109C for ; Thu, 23 Aug 2018 16:26:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1B3B2C430 for ; Thu, 23 Aug 2018 16:26:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E61C22C446; Thu, 23 Aug 2018 16:26:42 +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.9 required=2.0 tests=BAYES_00,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 A0A2F2C430 for ; Thu, 23 Aug 2018 16:26:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727563AbeHWT4r (ORCPT ); Thu, 23 Aug 2018 15:56:47 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50958 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726238AbeHWT4r (ORCPT ); Thu, 23 Aug 2018 15:56:47 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A894087A78; Thu, 23 Aug 2018 16:26:19 +0000 (UTC) Received: from llong.com (dhcp-17-8.bos.redhat.com [10.18.17.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id A7E6310CD7CC; Thu, 23 Aug 2018 16:26:17 +0000 (UTC) From: Waiman Long To: "Darrick J. Wong" , Ingo Molnar , Peter Zijlstra Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, Dave Chinner , Waiman Long Subject: [PATCH 0/2] xfs: Use wake_q for waking up log space waiters Date: Thu, 23 Aug 2018 12:26:08 -0400 Message-Id: <1535041570-24102-1-git-send-email-longman@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 23 Aug 2018 16:26:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 23 Aug 2018 16:26:19 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'longman@redhat.com' RCPT:'' Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP While running the AIM7 microbenchmark, it was found that there was a severe spinlock contention problem in the current XFS log space reservation code. To alleviate the problem, the log space waiter waiting and waking functions are modified to use the wake_q for waking up waiters without holding the lock so as to reduce the lock hold time. The result was a 4X performance improvement in that microbenchmark which is worth persuing. Patch 1 is an enablement patch to make wake_q service available to kernel modules. Patch 2 changes the XFS log space reservation code to use wake_q for task wakeup. Waiman Long (2): sched/core: Export wake_q functions to kernel modules xfs: Use wake_q for waking up log space waiters fs/xfs/xfs_log.c | 48 ++++++++++++++++++++++++++++++++++---------- include/linux/sched/wake_q.h | 5 +++++ kernel/sched/core.c | 2 ++ 3 files changed, 44 insertions(+), 11 deletions(-)