From patchwork Fri Jun 22 15:12:19 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: 10482393 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 7A2CF60230 for ; Fri, 22 Jun 2018 15:12:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76F27289A2 for ; Fri, 22 Jun 2018 15:12:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BA5C28BB0; Fri, 22 Jun 2018 15:12:37 +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 EAA87289A2 for ; Fri, 22 Jun 2018 15:12:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B58A86B000A; Fri, 22 Jun 2018 11:12:35 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B07F66B000C; Fri, 22 Jun 2018 11:12:35 -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 A1EA86B000D; Fri, 22 Jun 2018 11:12:35 -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 4974A6B000A for ; Fri, 22 Jun 2018 11:12:35 -0400 (EDT) Received: by mail-wr0-f197.google.com with SMTP id j14-v6so4565164wro.7 for ; Fri, 22 Jun 2018 08:12:35 -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=RFRdFd+9lzqxsZzRtROeGB3uPPMp6VTCqxLZXnp/9do=; b=thcFCgsBU6+KbNItUfiy1492aFRHZpAn17J3Hz4qncOU50vp37N25QgTenSThInTF7 ePTxAB/TfAmnxVvKvQejBaobK9rWOyQbIx6Vt306pZ2fL1vLB8lWQ+j6GqsnP9Tp0j3G ouhhab4NntNYlo4tntHk++5fVXXslI+O2KgGcNR1wlAxBrUT+NERNuRuYoWu10L9zGuJ KLkjJdGjX5BPd+XeoInE1tgUXt51bVugeOJVEqyGKg0AbFbiMmpLiqN/OCqCc7bDKFqs bJowqLGvba7K1c4r5qqUaqme8+X+UuhWGDTONTRhQGb7TtRZuwyiKx4W7YHH4ejDtFQl aeBg== 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: APt69E0Kqqjod5J9uzJzS43NeubcZSP4P/4aTUXLP2kMx/ePmfIMzawk SUU5sRKxtrEOvW4ezPbG0WZ0EVd5otRzVI5361hQHmTohjpFMTa7/Qym0xK2B+lTy++LnDofYmp xjTDCskpccckfPI6aGrWcuqKJY9lhowpSIctHPgTkbPH9N7doRiLT18OT6Istdq8LUQ== X-Received: by 2002:a1c:9106:: with SMTP id t6-v6mr323618wmd.2.1529680354868; Fri, 22 Jun 2018 08:12:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeL/PMF2bTednPZP1vr5KJRZHN4bVpO4GE1Isj+YLwFmB39QZqeKJr7HyubsyLtsOowhSjZ X-Received: by 2002:a1c:9106:: with SMTP id t6-v6mr323579wmd.2.1529680354114; Fri, 22 Jun 2018 08:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529680354; cv=none; d=google.com; s=arc-20160816; b=fTmIhRJJMsHq/fI7MlVTgbr+/Ka2rMMrNQE5QxKWJftBSHMCaxBmKs8vBGS0UEBhCE Jfm6WkLD5Hi/UbxY/223S8GcQhXIUEeWncb64aBPLYYipqmSf9TgJPuU6DVxK/mNSFqY 9s4QpTamvC0I8pkFyLAW8CfWe6DcOCIXD72chnceLle3+UMNcNyOh7xepea0slzrScBb 03Ol0DjCj3UJceRz45a2F7WjcHCFwGNiAfvaQLwkidyXys6b+dJfdeG2xZHswYl20bQc jLvW+EHT4S4D9lFsAMUiSe9+FYIqwC5lCb8OnBoD3TUg5ABSMhccAEZ1Z08hCNpVuBlW geRA== 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=RFRdFd+9lzqxsZzRtROeGB3uPPMp6VTCqxLZXnp/9do=; b=v0yeR/RiStwVNv/dA2aenoTKur4QM5D9dODsf+e5sBGtvSsh2Nd2txfFBsBOqERYYe s5pI5mJMKZ40Zx0GYOu5NynLXTpH/ImGwoMZDKNxVjpjiFlbwxJAodgvPN8nOs88ycqV LkJSQBIxNYzj/oWfEchw4GwwUiW5zXByIh0WYI1vTUr7qDEWSm2TK3oTN6jCNZp8wq6q yjeSdUhiCD0veA/TFdTjGdyuxGR3Szd3CrNgcNEUjXKzvSdSfx+2A5pk8O2m3srqBY8M tIvKZgsAn77ZKIexfBqnsK1LZqBjQ6JfnBDmUTrCJU4cAi4R9WS+2DyGmvGBDjsabOF7 1fZA== 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 p26-v6si4221658wra.244.2018.06.22.08.12.33 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 22 Jun 2018 08:12:34 -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 1fWNjj-0007Dp-Ss; Fri, 22 Jun 2018 17:12:32 +0200 From: Sebastian Andrzej Siewior To: linux-mm@kvack.org Cc: tglx@linutronix.de, Andrew Morton , Sebastian Andrzej Siewior , Kirill Tkhai Subject: [PATCH 1/3] mm: workingset: remove local_irq_disable() from count_shadow_nodes() Date: Fri, 22 Jun 2018 17:12:19 +0200 Message-Id: <20180622151221.28167-2-bigeasy@linutronix.de> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180622151221.28167-1-bigeasy@linutronix.de> References: <20180622151221.28167-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 In commit 0c7c1bed7e13 ("mm: make counting of list_lru_one::nr_items lockless") the spin_lock(&nlru->lock); statement was replaced with rcu_read_lock(); in __list_lru_count_one(). The comment in count_shadow_nodes() says that the local_irq_disable() is required because the lock must be acquired with disabled interrupts and (spin_lock()) does not do so. Since the lock is replaced with rcu_read_lock() the local_irq_disable() is no longer needed. The code path is list_lru_shrink_count() -> list_lru_count_one() -> __list_lru_count_one() -> rcu_read_lock() -> list_lru_from_memcg_idx() -> rcu_read_unlock() Remove the local_irq_disable() statement. Cc: Kirill Tkhai Signed-off-by: Sebastian Andrzej Siewior Acked-by: Vladimir Davydov Reviewed-by: Kirill Tkhai --- mm/workingset.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/workingset.c b/mm/workingset.c index 40ee02c83978..ed8151180899 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -366,10 +366,7 @@ static unsigned long count_shadow_nodes(struct shrinker *shrinker, unsigned long nodes; unsigned long cache; - /* list_lru lock nests inside the IRQ-safe i_pages lock */ - local_irq_disable(); nodes = list_lru_shrink_count(&shadow_nodes, sc); - local_irq_enable(); /* * Approximate a reasonable limit for the radix tree nodes