From patchwork Fri May 4 15:45:31 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: 10380897 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 37317603B4 for ; Fri, 4 May 2018 15:46:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 249F129434 for ; Fri, 4 May 2018 15:46:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19210294D7; Fri, 4 May 2018 15:46:01 +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 B7BCC29434 for ; Fri, 4 May 2018 15:46:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1EB346B026A; Fri, 4 May 2018 11:45:56 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 197906B026C; Fri, 4 May 2018 11:45:56 -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 0B0936B026D; Fri, 4 May 2018 11:45:56 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm0-f72.google.com (mail-wm0-f72.google.com [74.125.82.72]) by kanga.kvack.org (Postfix) with ESMTP id BE6E56B026A for ; Fri, 4 May 2018 11:45:55 -0400 (EDT) Received: by mail-wm0-f72.google.com with SMTP id 74-v6so2195289wme.0 for ; Fri, 04 May 2018 08:45:55 -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=bXT1hD5vEnx3DfAZt1YteqsHsc/hqlqlnzTYPkO6bg4=; b=Oy1Kb11Pi3cCQ8xAOxL1h6HX5bJ0lD0R99LwWZRT8YMddZh0EhqY4q6QlsfxzEfR2L pkAdDuGQWjgR/reFQYCTfbM4OacbveLmKjPAB8n3pJ+0uPQxLfRJcJRVYLZ8vphSRZR3 MmO0Ql7WuWHkwC3DJ1YJV7j3/kfhxRbrR62hQW0niOiNuD0EDhCPqcVOTo25mj3A1ZI5 CjQ0+re8M0uW5v8U6UgHU6MmnLV4C7iEC7BRLztNo8rDROnNagYUDE8sxMkQucRQkv2T dN7QggpyuUEXEra7gg65uj8BeM7V9G8P8qaBxOk3DWbNWjVILHc24iTgTxNNXxg1/ePc KA1g== 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: ALQs6tDN83ZWDrDkLGs2dI78w6ykItZf4XVfoKMJI1CxY2ESJd3jwKu+ fLdqjoDnYZtae+po59ylVoWzbE3Sd478nqu1Hn3Me1JoVwC7JqXxiEHkiAvegexAaIeCrS8KbQ4 LHs4KoLxstHstZGNyehbMIHosZEFdXmsaFLdFGvF8La2seRIB6wKf0zNri3EC2cTFfw== X-Received: by 10.28.234.26 with SMTP id i26mr1991531wmh.11.1525448755321; Fri, 04 May 2018 08:45:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoBLhq9IWvHWjDFbaS2dNWzSqu+Ihwoavnpof/RcZfXdcrQ10drThafnR49II0jN4K6eUF1 X-Received: by 10.28.234.26 with SMTP id i26mr1991504wmh.11.1525448754530; Fri, 04 May 2018 08:45:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525448754; cv=none; d=google.com; s=arc-20160816; b=e5f6FMqa/hE4yOAzv1IRiiGyxZD+ZBiJvrT2BohHcRvBl6/826HZ+XJ2Sc+hwvZ9/C M8fP+CkPJr/RGnzTvtX151HRglXUnMshwt9bQuyJj1ETngM3mztURo46aDlpTVEgqZfa qPSM4QxvqRzy2bPlN6rjdYsfU4ayI2vIKaslnWsYSk9SslL2jmMoRzartGP9QP8ioT5R sXb94u7PXIP8cNO0JQW8RfOK4G/pKJBEVi7gTFryKILa9QP/S+UNZKQclgM/nCjXX6XR IhfAwn/oAozgQn3yVUqbzP0Y0ptpTNOR42zgjrUaYW+KpjJ+IVArAqlUAdw5IJ9SyX2A 2Zfg== 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=bXT1hD5vEnx3DfAZt1YteqsHsc/hqlqlnzTYPkO6bg4=; b=JmAztq1VjfPl/kgvEU+3zPi4IYyu9MvzJqZ5zx4/QouYrzqRugHxxk81IGFnqInVxK u/GV2SSak2c+Q0btzz8WFY9pUWi+xox+k2LGTX1ELz85XMOjNeSGFIbz+FclgsqYvoaw TWkIkMLUmxa4FlXueo0BBtyoy/fzLz0gir8I+QyE+t+EehcyKAl6YyzPw24cQWr3VsPb wemTKqWuXXroeaykRw0662Dg3l6fQFeCyR3pheO9mdTcOy5qmLPYorqlCrJ2GRUDmC8u wMT2hzgguHLRRXIOsRE62H7nk8MuoVrqTdWbvay+j1o/e3L8BGjK1/CncpiuhrKEJ43b 47xw== 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 33-v6si13667687wrn.239.2018.05.04.08.45.54 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 04 May 2018 08:45:54 -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 1fEcu7-0006lh-9E; Fri, 04 May 2018 17:45:51 +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 3/5] kernel/user: Use irqsave variant of atomic_dec_and_lock() Date: Fri, 4 May 2018 17:45:31 +0200 Message-Id: <20180504154533.8833-4-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 --- kernel/user.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/user.c b/kernel/user.c index 36288d840675..8959ad11d766 100644 --- a/kernel/user.c +++ b/kernel/user.c @@ -169,11 +169,8 @@ void free_uid(struct user_struct *up) if (!up) return; - local_irq_save(flags); - if (atomic_dec_and_lock(&up->__count, &uidhash_lock)) + if (atomic_dec_and_lock_irqsave(&up->__count, &uidhash_lock, flags)) free_user(up, flags); - else - local_irq_restore(flags); } struct user_struct *alloc_uid(kuid_t uid)