From patchwork Fri Jun 22 21:39:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 10483065 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 6B7866023A for ; Fri, 22 Jun 2018 21:39:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5506B28DF6 for ; Fri, 22 Jun 2018 21:39:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46BD628EA6; Fri, 22 Jun 2018 21:39:06 +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 D2B6328DF6 for ; Fri, 22 Jun 2018 21:39:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A5C5D6B0003; Fri, 22 Jun 2018 17:39:04 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9E4956B0005; Fri, 22 Jun 2018 17:39:04 -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 8AE996B0006; Fri, 22 Jun 2018 17:39:04 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f198.google.com (mail-pf0-f198.google.com [209.85.192.198]) by kanga.kvack.org (Postfix) with ESMTP id 4456A6B0003 for ; Fri, 22 Jun 2018 17:39:04 -0400 (EDT) Received: by mail-pf0-f198.google.com with SMTP id j25-v6so3760905pfi.20 for ; Fri, 22 Jun 2018 14:39:04 -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:date:from:to :cc:subject:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=jWltca3BudWPotwbVpp5WTq7GdQ/dT7UTj1dN5Z7MX0=; b=GAlWi0RTw1na4Vb+LvLTswVZ96bvr53I3M2Gpz/U2nHSz+jc4hnS56riwd7vor1vkS glNsrl7JmvofCUi9XYN+y+11ocMChRbor6EELtfngHcn2W02iTbmJfd5wbzF5bn7F8UE tI5MA3AM/tgMCYt0jQZl0kQjZQePWnFdWcPdIkl7hGQqtc4SmnWl8+ROb1vtHjSe4jGI wN3jID5Kvmf3m0Y49SiR+6Kh5wH4Ga/i+AWQ2laX3oidln/nGeGN7lygGTITeFDqHXPd +Nx+9eDsvl8kAAeB6A+G/e3Zo1XsOrNVYasmST1j++dUA7jEQDnh06CqxlNemdpRGCfo hNSw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of akpm@linux-foundation.org designates 140.211.169.12 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Gm-Message-State: APt69E1fKz0qY326QUv7adEkJNCqCQXIlLXbfx2NDICTuaiv1uo8Rj56 kHKN87DQhyT1jwVrYM/UOK5XmDDwzBwOqzmAN52IIlo+Nl4eCYGxUsQc43ww2xy8SYgPsluoAA3 Nck7Rh8UFnNBhWoWpOTB23Mk3PTdqL8iV7i3vkijhjmewAIMchtBkP1IVUh//stG0hQ== X-Received: by 2002:a65:6604:: with SMTP id w4-v6mr2820802pgv.346.1529703543931; Fri, 22 Jun 2018 14:39:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIplpTbCZvXSO6kkky9YC5dyO0SCwC13vgu1Kal4XqTVboJDagGkr5z5ya+jBQXu848exkl X-Received: by 2002:a65:6604:: with SMTP id w4-v6mr2820780pgv.346.1529703543078; Fri, 22 Jun 2018 14:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529703543; cv=none; d=google.com; s=arc-20160816; b=T4tT8xtLvudlzrhlRcGVo5aAT3Xaext7HQEHs+jGPbJqeQYnjYbqb6dK9UyxQKSksN 4vMfC2blM8zumJc1vtd/GJ94EYXsgUopGjlDMajjYk6zW5HdbRxWVwC40Ehnco1b5Fzl GXKeJR8D3xMeq6iUl1PBwkW6sdC7txLaoYdzxLFdB/nC1oNWlVXur+sRhz6soljoWp83 PleoDvgSYQadqMxq6pnV9uT39Nw5jOi8MctEmFVJ5fUajKw+VU4jFIKlFh+uQCbL/qEs DsGlUoFsFEP1bMhhenUoDg9KCq2oU/bWTGvDHjR2ECYsC8ZNXEhM+5GjAbZ6yuUIYXVh EODQ== 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:subject:cc:to:from:date:arc-authentication-results; bh=jWltca3BudWPotwbVpp5WTq7GdQ/dT7UTj1dN5Z7MX0=; b=gh1gSlIxYjhZ8XKPSztf+1DAVCrFx8MoqK+vkIdYHF4whaTrDr3w3m5eq3O4kS/+nt WpFnNJ6sM81G/lCZ72F0NmpYxDPgCL3ryIzPDehfrPCJmW75Np1ZekvqhWn3UuUZ77LA UvCaTf96JcG8KaXo1+XvJ8cbnTo4MkFc2F7EAvfQqoGU8IvnbkeQJ1EJKYd6xmKNP3be KESonCi05X8U/CHEn+XXXTVW2D6vGWNdR7pJpwlGWbznTvNaowe86C7xILsNAOu0fZ3L MwmljtELvfI7UeG08MgumF7eEEvmkns2FywicsuLDS5JeL+dDJTnkOhv8+rWEHtBQzqN EiOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of akpm@linux-foundation.org designates 140.211.169.12 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org. [140.211.169.12]) by mx.google.com with ESMTPS id n1-v6si6656484pge.263.2018.06.22.14.39.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jun 2018 14:39:03 -0700 (PDT) Received-SPF: pass (google.com: domain of akpm@linux-foundation.org designates 140.211.169.12 as permitted sender) client-ip=140.211.169.12; Authentication-Results: mx.google.com; spf=pass (google.com: domain of akpm@linux-foundation.org designates 140.211.169.12 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org Received: from akpm3.svl.corp.google.com (unknown [104.133.9.92]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7CFC7A92; Fri, 22 Jun 2018 21:39:02 +0000 (UTC) Date: Fri, 22 Jun 2018 14:39:00 -0700 From: Andrew Morton To: Sebastian Andrzej Siewior Cc: linux-mm@kvack.org, tglx@linutronix.de, Kirill Tkhai , Vladimir Davydov Subject: Re: [PATCH 0/3] mm: use irq locking suffix instead local_irq_disable() Message-Id: <20180622143900.802fbfa2236d8f5bba965e2e@linux-foundation.org> In-Reply-To: <20180622151221.28167-1-bigeasy@linutronix.de> References: <20180622151221.28167-1-bigeasy@linutronix.de> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) 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 On Fri, 22 Jun 2018 17:12:18 +0200 Sebastian Andrzej Siewior wrote: > small series which avoids using local_irq_disable()/local_irq_enable() > but instead does spin_lock_irq()/spin_unlock_irq() so it is within the > context of the lock which it belongs to. > Patch #1 is a cleanup where local_irq_.*() remained after the lock was > removed. Looks OK. And we may as well do this... From: Andrew Morton Subject: mm/list_lru.c: fold __list_lru_count_one() into its caller __list_lru_count_one() has a single callsite. Cc: Sebastian Andrzej Siewior Cc: Kirill Tkhai Cc: Vladimir Davydov Cc: Thomas Gleixner Signed-off-by: Andrew Morton Acked-by: Vladimir Davydov --- mm/list_lru.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff -puN mm/list_lru.c~mm-list_lruc-fold-__list_lru_count_one-into-its-caller mm/list_lru.c --- a/mm/list_lru.c~mm-list_lruc-fold-__list_lru_count_one-into-its-caller +++ a/mm/list_lru.c @@ -162,26 +162,20 @@ void list_lru_isolate_move(struct list_l } EXPORT_SYMBOL_GPL(list_lru_isolate_move); -static unsigned long __list_lru_count_one(struct list_lru *lru, - int nid, int memcg_idx) +unsigned long list_lru_count_one(struct list_lru *lru, + int nid, struct mem_cgroup *memcg) { struct list_lru_node *nlru = &lru->node[nid]; struct list_lru_one *l; unsigned long count; rcu_read_lock(); - l = list_lru_from_memcg_idx(nlru, memcg_idx); + l = list_lru_from_memcg_idx(nlru, memcg_cache_id(memcg)); count = l->nr_items; rcu_read_unlock(); return count; } - -unsigned long list_lru_count_one(struct list_lru *lru, - int nid, struct mem_cgroup *memcg) -{ - return __list_lru_count_one(lru, nid, memcg_cache_id(memcg)); -} EXPORT_SYMBOL_GPL(list_lru_count_one); unsigned long list_lru_count_node(struct list_lru *lru, int nid)