From patchwork Wed May 9 19:36:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 10390685 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 7255B60540 for ; Wed, 9 May 2018 19:39:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61B9F28469 for ; Wed, 9 May 2018 19:39:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 562C1284D4; Wed, 9 May 2018 19:39:04 +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=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA15128469 for ; Wed, 9 May 2018 19:39:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8D6366B0574; Wed, 9 May 2018 15:38:49 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 846D06B0576; Wed, 9 May 2018 15:38:49 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 63A3C6B0577; Wed, 9 May 2018 15:38:49 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr0-f197.google.com (mail-wr0-f197.google.com [209.85.128.197]) by kanga.kvack.org (Postfix) with ESMTP id EE3546B0574 for ; Wed, 9 May 2018 15:38:48 -0400 (EDT) Received: by mail-wr0-f197.google.com with SMTP id p7-v6so24675304wrj.4 for ; Wed, 09 May 2018 12:38:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=3dbo6mvfqxCAa75cXXQ/zZhUHNw71CfzLfQgngfRYzQ=; b=MOCYFdITOUh+Rhu9dlxCRcYIUxSHN0hbs51YeE59D+yiLgpTpLFLoGpbAxK+uACQDI QHrEOXSHs7FVda/hn8e/4pUUYbXKAIbNER/XhnSAczz2yqQ3aRvgpVNEFfzxQHcXypTz GbL+noV7bRS1uJiaPTbmiV60XK/I+wKEq3P2eh1WZYXEiN5NjsVZ0op3AYPkKGe9b4yZ 6NpJ+WdboxHT9ti5g2t+gduJ7jgWe/7nKdm8Nt1DCOU3E+KELTsmN7nh1v8DtJVpNowS UAwZIvjr9Fwhe+o/FPi4HwvLQzezipHVD0UcT+AWqaFvLz7nA8AgLAOSMtYdENC7KYrS SHmA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bigeasy@linutronix.de designates 2a01:7a0:2:106d:700::1 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de X-Gm-Message-State: ALKqPwe7BfVhTykaWdlp/ptce0F1Q+NTKT+Z8OGnZPpX1NDBtQft4P+2 xvkdd8ROgpQEbHjvmFflrs8C9EYE7OuUYOt2Eav0IJq3QyLyIqDkkbR3Nod1B3tPU3IG9IioTIv 3YX5V0q7OXKTMCeOwjvAOYnuZD0cvlcTVPT5pvrhe+FTddMFKoPoxyWgsY20b1U+6sw== X-Received: by 10.28.127.10 with SMTP id a10mr7119921wmd.97.1525894728540; Wed, 09 May 2018 12:38:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqvL9OX5M3aNiHp9Ti1uMIbVfWkx4YBkQbGDbkNpSm/5zX7xcymHMT3vDFjZyNn07/fHbNP X-Received: by 10.28.127.10 with SMTP id a10mr7119902wmd.97.1525894727764; Wed, 09 May 2018 12:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525894727; cv=none; d=google.com; s=arc-20160816; b=hBDVu5qf97miB++7UG9aCg2Q6up7y+JYmjwFsm/VC/2f8VytBB4Jr5RZ0vawB5EPGZ ULBbu0BxQFuomjkZWMZoYRruzq31KfvlxpvcTu296eHevppnM2/xN+46Ck+NNycZCt8E VSfZc+DCgMyC3393ZpE7MpREvb/+yoYxxY5/nMqMvNfso55gD2BzJQOLrvLXLK9wlYya Bw3L7B3vYEXYdsJo10p5eDioeiK2fEedjuMNJKR5HCvdOsTsB+VNy2adXKIdkde1MiPY z6kVvXUAb2Y2HO3qM3ntlIhFoHjetLw6qfIMEdAS0IpJuPOyKSHKrFYMvvV8iZgooqAA YEKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=3dbo6mvfqxCAa75cXXQ/zZhUHNw71CfzLfQgngfRYzQ=; b=TQEVNCDO0mhti/NtvPJYfjUnesPB3/8xV6+/fL1j6tQaz3/UaDySxsdu5BqN84M4kn TBcuUZMS6hiiY6L2rc/AoTvUUXF/H+sEZzsRh512MDG2m8gmF4VYeIat4SDi8n4Uo/Bs k5m/M3Y9nN+XNY5w9HZEBjaOLCBixhyspqsLIwa15s5zhpBbeK2eOiYUB/7zdaxQkZVi jC6hBtQaiqp9TzcWxodRfklrtkH8wcEqruuJFIeV7/rZLtGeMBDBz14c7BHtqEgWIpNF wOKTwTAjjvDN95eV0/R5SYZ/ESPzr02JoYLaFz3jOgqKDbIekG4fQItY2MkuN+RJEgCI 82kA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of bigeasy@linutronix.de designates 2a01:7a0:2:106d:700::1 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de Received: from Galois.linutronix.de (Galois.linutronix.de. [2a01:7a0:2:106d:700::1]) by mx.google.com with ESMTPS id c1-v6si10492352wrf.71.2018.05.09.12.38.47 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 09 May 2018 12:38:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bigeasy@linutronix.de designates 2a01:7a0:2:106d:700::1 as permitted sender) client-ip=2a01:7a0:2:106d:700::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bigeasy@linutronix.de designates 2a01:7a0:2:106d:700::1 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1fGUvD-0005v9-7n; Wed, 09 May 2018 21:38:43 +0200 From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, Peter Zijlstra , Ingo Molnar , linux-mm@kvack.org, Shaohua Li , linux-raid@vger.kernel.org, Anna-Maria Gleixner , Sebastian Andrzej Siewior Subject: [PATCH 7/8] md: raid5: Use irqsave variant of refcount_dec_and_lock() Date: Wed, 9 May 2018 21:36:44 +0200 Message-Id: <20180509193645.830-8-bigeasy@linutronix.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180509193645.830-1-bigeasy@linutronix.de> References: <20180509193645.830-1-bigeasy@linutronix.de> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Anna-Maria Gleixner The irqsave variant of refcount_dec_and_lock handles irqsave/restore when taking/releasing the spin lock. With this variant the call of local_irq_save is no longer required. Signed-off-by: Anna-Maria Gleixner [bigeasy: s@atomic_dec_and_lock@refcount_dec_and_lock@g ] Signed-off-by: Sebastian Andrzej Siewior --- drivers/md/raid5.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 57ea0ae8c7ff..28453264c3eb 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -409,16 +409,15 @@ void raid5_release_stripe(struct stripe_head *sh) md_wakeup_thread(conf->mddev->thread); return; slow_path: - local_irq_save(flags); /* we are ok here if STRIPE_ON_RELEASE_LIST is set or not */ - if (refcount_dec_and_lock(&sh->count, &conf->device_lock)) { + if (refcount_dec_and_lock_irqsave(&sh->count, &conf->device_lock, &flags)) { INIT_LIST_HEAD(&list); hash = sh->hash_lock_index; do_release_stripe(conf, sh, &list); spin_unlock(&conf->device_lock); release_inactive_stripe_list(conf, &list, hash); + local_irq_restore(flags); } - local_irq_restore(flags); } static inline void remove_hash(struct stripe_head *sh)