From patchwork Fri May 4 15:45:30 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: 10380895 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 5E6AC603B4 for ; Fri, 4 May 2018 15:45:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BCFC29434 for ; Fri, 4 May 2018 15:45:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40A2F294D5; Fri, 4 May 2018 15:45:58 +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 DD430294D7 for ; Fri, 4 May 2018 15:45:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 62F4B6B0269; Fri, 4 May 2018 11:45:55 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5905F6B026A; Fri, 4 May 2018 11:45:55 -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 45A546B026B; Fri, 4 May 2018 11:45:55 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm0-f71.google.com (mail-wm0-f71.google.com [74.125.82.71]) by kanga.kvack.org (Postfix) with ESMTP id DF37B6B0269 for ; Fri, 4 May 2018 11:45:54 -0400 (EDT) Received: by mail-wm0-f71.google.com with SMTP id f188-v6so1105397wme.2 for ; Fri, 04 May 2018 08:45:54 -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=0DRjG3pH/nwG3udqeNacjPWDjZ6gYcNTnJ+x0VF73ak=; b=pYFObNLgboJMW8GQTiLPbD7EwbJwY0TZ0kr/okwnIlVEvThJnXmia4s+lkOssXpf1t bkJrLalBLWFchFv95KmKnJSUtQLhfjnlMWAEAf+iQurcAj2pcOL9z3MLRCBgCzOwtVwv yXyXM+p/R2UCiMEc+QZTReezL8yFkWQhF/PasO6cdk8ibXKSTefMw95sANlPhgL4j16m e2szFKOr3BgYio6H7W4NVnRihQMdHVOjGwdPWk64M5dnMuJQ4mcSp3TIWHhexHRVn3q9 SBJT7QgABSHkuPWzHxJiEoTO7nJCwR9YL4zOzicMZgw3gJPberzs1DCpm5DcB/OZteo6 DzlQ== 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: ALQs6tBZcUsqAfbSh/4qxClhJSGih4Naie6nJtyqLpmWOmpKSdb2fUpj XRqhycRVLKtcqbWBOWY9U2+oTzwDNPeb3x2FAJkTZY7RAcxjZhjOZ7DmyTA2hpH6F4YaPgSL1+D mh5V0WBS1IKAnytKBLnzREZBwJ5TcY+UA0ZiD3aJlERYWZYDifL7yf1SA/sD6GRk7iw== X-Received: by 2002:adf:8248:: with SMTP id 66-v6mr22760825wrb.127.1525448754464; Fri, 04 May 2018 08:45:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZozFlfGyID8bocR5SuCmgKk/whFWSgsllqXl2DMO+D3EzXp0xLsTND+Azxs46/eRtvdPVOa X-Received: by 2002:adf:8248:: with SMTP id 66-v6mr22760791wrb.127.1525448753740; Fri, 04 May 2018 08:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525448753; cv=none; d=google.com; s=arc-20160816; b=iZUXbMeTGZNf+9KKHNQhY29H6IFYmfK6K59Fw/0oDZf6P/h0um1GngTaWxEOLRo6bU D+ddvCp6X6a/cGnflhr13SFwGMJ155o0Q+NffsknCwwft5n0K/qiAiJQFxsNwzlVhXOD tJB+7qZ+cCWroEmmdCtZ8dJP1waOH3S3RBoofzWbHt1y5/0QnO+NRNvVL90gd7tkrFkE CO/AogmZLgq8v6QetK0IRMiGMJzUWju3i16ohM/TPua/swSCv8SJFZmBZtpbUys45B76 4OHNEMb/lUJRabW4MX8SxqUmXYkUjy/MyUyK1DaSatSyKY1bO7K1oQpNUJIbg5F/+Oyt J+UQ== 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=0DRjG3pH/nwG3udqeNacjPWDjZ6gYcNTnJ+x0VF73ak=; b=BcHCIQSaQ50jZHfj4ZqrCtO2o/jDU2OolcypbFFreF30Yo3Pfc6EATxfj6DkW+fbCC 0sMLnRmongkn9BDyc20h486AHecNBQfY6yfRjXNJsacoJqFWBZsSEVgWFg/XAxzbNP/j UyVnyATQzAdzLV45S6ScFpFs4KnHAkBdWh1CCLgGOeujaSFk9IHN1d3QB36fGwPO0u8Y NatYQcpL/mhtqFMrW0MjOHlFfDuiNMjjDVA9CxOw14LSkAsIaQnaM3wC3qSscyN1QCcU asjfdhThmGrb8qXyeDOJ27wGKWCihw87/lgz4E6ilkGd21omDKwGof7Vj/1cImgxqNe+ eKAw== 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 u55-v6si13169196wrf.181.2018.05.04.08.45.53 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 04 May 2018 08:45:53 -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 1fEcu6-0006lh-5l; Fri, 04 May 2018 17:45:50 +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 2/5] mm/backing-dev: Use irqsave variant of atomic_dec_and_lock() Date: Fri, 4 May 2018 17:45:30 +0200 Message-Id: <20180504154533.8833-3-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/restore is no longer required. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- mm/backing-dev.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 023190c69dce..c28418914591 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -484,11 +484,8 @@ void wb_congested_put(struct bdi_writeback_congested *congested) { unsigned long flags; - local_irq_save(flags); - if (!atomic_dec_and_lock(&congested->refcnt, &cgwb_lock)) { - local_irq_restore(flags); + if (!atomic_dec_and_lock_irqsave(&congested->refcnt, &cgwb_lock, flags)) return; - } /* bdi might already have been destroyed leaving @congested unlinked */ if (congested->__bdi) {