From patchwork Fri May 4 15:45:32 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: 10380901 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 C1306603B4 for ; Fri, 4 May 2018 15:46:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE30629434 for ; Fri, 4 May 2018 15:46:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2CFB294D6; Fri, 4 May 2018 15:46: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 6896F29434 for ; Fri, 4 May 2018 15:46:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 803636B026B; Fri, 4 May 2018 11:45:57 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7B37C6B026C; Fri, 4 May 2018 11:45:57 -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 67DCC6B026D; Fri, 4 May 2018 11:45:57 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm0-f70.google.com (mail-wm0-f70.google.com [74.125.82.70]) by kanga.kvack.org (Postfix) with ESMTP id 083736B026B for ; Fri, 4 May 2018 11:45:57 -0400 (EDT) Received: by mail-wm0-f70.google.com with SMTP id f21-v6so1099690wmh.5 for ; Fri, 04 May 2018 08:45:56 -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=IBVdmo72JVJPBxmJ81hZYuj2GLKy3RxXk4u/p+Di6JY=; b=geFnmzDUe2rJb8Coeoqp1AMlwMyKndIgV5JZnWfmc3evurcmjz2jrJN8G5dHjD0ae3 CgorQQh4giTMRZdtth5ARpkOqFQJ37IKCQ8DQN0WjHlJTCaz4FsiOaHxnpPKxZl7u1sv 5Ylr2wfuUQiZyqg0u6ud+rjDSAFUf3r7/E9brimLzuee917EddCVZDF4E6hv6RSk6csm u8rpevYeLZ1jzd0Z8QQQHA0Ead8ZcGUiBKXypCepTvY7jWyK1eAELZDTZ6A4UJ8AKCH0 oO8GcQXyovzs33LAEdMyudl7S7J26Jv1ngNch0xkfdiID9JkgNqpdlJA7TUbefJX4Ufq mlMw== 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: ALQs6tAr51AzF9ou2y99m7IxgDVWfBTDzQkK8AYfkKOR0qc+/FSch3vO KZfLVTfia36/imv64c8Jufw4pp/gZmajgxX9cjH0CphnUrQNOrtr/k0PSkQQxbnz8tAFDQpba1L myruDqiqU5MUuQIF9tITdDwkSs8y5o+L6m/dH5/6x4HDUMSD/YwK1RvSNcv9SuCPzmQ== X-Received: by 10.28.177.9 with SMTP id a9mr12327360wmf.18.1525448756535; Fri, 04 May 2018 08:45:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpMUWvtHx9ZB3yk39+W2ADt1NmdsQB/KsLOruoG8NtpOu1A3Sk9HvDYGUnbw7ixw5ZucxDa X-Received: by 10.28.177.9 with SMTP id a9mr12327323wmf.18.1525448755677; Fri, 04 May 2018 08:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525448755; cv=none; d=google.com; s=arc-20160816; b=eot0u0FQFXNpzh95tIO05gwgTTiDRyuzgUb+l43R/KXjL+Ylf2JP3pUn+n4xJlEaxP 8P1sYkd91qPPFpFROPh/T+dF6wFiCypyjZwMf6pEmLYI2tv//TtvWAj5VR11Y1YlzHyW gNWQzlFp4RVAx/Ic4kpCFrUEguqBQFWOEjgcnKvgiQX+DN1my+XEP5V3zOfV8e9wBl92 t2S0mYdv2HBk+sGUE7FYfrK94CzHmk9oypnCt0ikpm86N/cucbSl/L6KZR8n86uR7m52 hR/CuIRmfo9FKWsqqLX4oa29MTW3RuNnbtuxCpHYkKgjZI8wTi6lPvdVLVjoEGcxHf/J WKAg== 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=IBVdmo72JVJPBxmJ81hZYuj2GLKy3RxXk4u/p+Di6JY=; b=Fdd15/DR1SNsG6U3R9/ng4JDwU56A9EothOuQWk64K7GlmZrdnne/1uIvXQE8dXLkW i8c8V6a/CeJFFiDf4uwIHscfoPoBc4qZ0tQBwcXbXvyDv2wAxjxLtsYK8sMo1iHgGrxF VZz+KbcveyS+Yr0NUTI1heTruXat/X16Af/ekj5Kmk9QWh8WGJXjkQqqaBYk/niCmXCA MZH/wnG3IUkCNUNU8o1shSwW0fEJQb2oCnpzfjYj22AM54uQ51VeKk3fS1WNaqc7EmrY FL4pRMeHOtB+E2Q8pP1k0wDmutlhi88MQa5vG9dYOUDFwlj6FXDHqzWLLtAcC+/znePo 5KLA== 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 197si1500095wma.98.2018.05.04.08.45.55 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 04 May 2018 08:45:55 -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 1fEcu8-0006lh-8e; Fri, 04 May 2018 17:45:52 +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 4/5] drivers/md/raid5: Use irqsave variant of atomic_dec_and_lock() Date: Fri, 4 May 2018 17:45:32 +0200 Message-Id: <20180504154533.8833-5-bigeasy@linutronix.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180504154533.8833-1-bigeasy@linutronix.de> References: <20180504154533.8833-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 atomic_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 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 be117d0a65a8..0a5e6f5d271d 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 (atomic_dec_and_lock(&sh->count, &conf->device_lock)) { + if (atomic_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)