From patchwork Mon Jul 16 11:19:20 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: 10526489 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 212E3601D2 for ; Mon, 16 Jul 2018 11:19:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12CCA28A52 for ; Mon, 16 Jul 2018 11:19:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0595E28A56; Mon, 16 Jul 2018 11:19:42 +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 9D0CA28A52 for ; Mon, 16 Jul 2018 11:19:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E8AF16B026B; Mon, 16 Jul 2018 07:19:35 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E3E986B026D; Mon, 16 Jul 2018 07:19: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 C8E976B026C; Mon, 16 Jul 2018 07:19:35 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by kanga.kvack.org (Postfix) with ESMTP id 6D8226B026B for ; Mon, 16 Jul 2018 07:19:35 -0400 (EDT) Received: by mail-wr1-f70.google.com with SMTP id r4-v6so8593735wrt.2 for ; Mon, 16 Jul 2018 04:19: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=lQx/d2JSsjzSX0MP/spKeytMMeoACkKLLEzcdg6QtXw=; b=gscx2SApSmDZZjrfYKaSMykTrQYM4UUbUlKslnJSq5hwU/m1yCxLhnJTLFR4fjIxnG j9gSj/2erkf5GRd4w7XXuGyuF2Vr0VK3Kk49znTn1CjMpUqQQtYv9nhZ47Vi450jSJLq Qw8lM9xdtQMqcG2nk1ZXlMEIOX7ILG4KCn+yDyWGrciiKpGH8Hhz1kj1lAhhvPo1XgrB ltHFmi6d9gEH1FGcjSq/YLcD1klJRkP1nDQVCrsTQJRqK5gJu6s8xSKni63D7Kxlh5mw kUvzwLTak6BL0xO34f048WaZN/dnT5edepqXYrnsIfvFE5Q1C55wurX0J6QwlYryx35a oi7Q== 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: AOUpUlEh6c0yHeZ8ffOOC86YNWaVF4VXLG4aE0OhDzt7sF8RtGCJ8V1R oLLN71Z2EAIrpm+Wn9ruRFTJMQqyfVbMNj6yJduLR5RPruWj7yKkyFYpUSPVS7TitLgt5EHlYoh S/xsJEQh8sepT/HQIdMKYOxfopJ+4H7nZDCAun39glNGDumNHcAO158HGtAp/GhNwFg== X-Received: by 2002:adf:f90d:: with SMTP id b13-v6mr11449614wrr.38.1531739975011; Mon, 16 Jul 2018 04:19:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcsHktrGaksJ8tSeBBQexaDnSlNzgohstrokXpxE3XjXnfLt7PcFf2z9ZZxJM1jLJoUEU6J X-Received: by 2002:adf:f90d:: with SMTP id b13-v6mr11449585wrr.38.1531739974320; Mon, 16 Jul 2018 04:19:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531739974; cv=none; d=google.com; s=arc-20160816; b=LpVW2P2dpl5A45yOy0mNuISAFTRdujiNIIlydwszDUHdjqug4MekjD0UpF8huoj7qB Gu9j8vEjma+z8QlYHGiNw9fUNd5gWxd3P1KdkQM1fEnIaWg0K/0BftRMOZC90wiI7kOJ HhDdIRfWNrJd0hWp9UV/qLWe2g9hbE6RPmzRQFo1URlVm6tWjFSTrhw+Ea7/4Y29AsOg WFO9M2nVhMTpR6MzNKUUJNSZ/bElQcg87Au6StqnGPn8A11dFeqPxVdYsoV38GAILWKS fjWPwr2xPYxFDoBdJs0CXU4mN6DKh7GpX7P6MRhoZKi9S0P6x1RIhIY8TMs0SBd/jW5j oL1w== 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=lQx/d2JSsjzSX0MP/spKeytMMeoACkKLLEzcdg6QtXw=; b=T8Yq8Yv5CtchiLCgJjY42AbKFNlH9EjNCyXWcrakQGTzECreOmoOQqd1iy5kbKNDbZ G/3LFoDiTvOlwou15tRYjrak+t6XqIY8CLFzqDVhgM/IfjOgTv19+zcQDv4H2n+mbV1+ QlSkOwqCi/Th88MMxyYXYvHBa+vCib7VALmprhV9UjuHxeEMF5cSdbe8vy2988BQvGHy yjCm2LyApX82rcX1wQQvcFSPhnkm9tKpzwus72HPq4RnizEK56KcCAYC0CBpvALuTM1y xicPw6JLnAs6RxgkKKISw97t9S17TzZ+scrj80QDfYbj3psIm9IaqyivWeYL4oUXp5+h zi8g== 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 l18-v6si9610017wme.197.2018.07.16.04.19.34 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 16 Jul 2018 04:19: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 1ff1XP-0003CQ-IN; Mon, 16 Jul 2018 13:19:31 +0200 From: Sebastian Andrzej Siewior To: linux-mm@kvack.org Cc: tglx@linutronix.de, Vladimir Davydov , Andrew Morton , Sebastian Andrzej Siewior Subject: [PATCH 3/4] mm/list_lru: Pass struct list_lru_node as an argument __list_lru_walk_one() Date: Mon, 16 Jul 2018 13:19:20 +0200 Message-Id: <20180716111921.5365-4-bigeasy@linutronix.de> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716111921.5365-1-bigeasy@linutronix.de> References: <20180716111921.5365-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 __list_lru_walk_one() is invoked with struct list_lru *lru, int nid as the first two argument. Those two are only used to retrieve struct list_lru_node. Since this is already done by the caller of the function for the locking, we can pass struct list_lru_node directly and avoid the dance around it. Reviewed-by: Vladimir Davydov Signed-off-by: Sebastian Andrzej Siewior --- mm/list_lru.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/list_lru.c b/mm/list_lru.c index 3e36e7a239e5..7b7a737f0963 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -216,12 +216,11 @@ unsigned long list_lru_count_node(struct list_lru *lru, int nid) EXPORT_SYMBOL_GPL(list_lru_count_node); static unsigned long -__list_lru_walk_one(struct list_lru *lru, int nid, int memcg_idx, +__list_lru_walk_one(struct list_lru_node *nlru, int memcg_idx, list_lru_walk_cb isolate, void *cb_arg, unsigned long *nr_to_walk) { - struct list_lru_node *nlru = &lru->node[nid]; struct list_lru_one *l; struct list_head *item, *n; unsigned long isolated = 0; @@ -283,8 +282,8 @@ list_lru_walk_one(struct list_lru *lru, int nid, struct mem_cgroup *memcg, unsigned long ret; spin_lock(&nlru->lock); - ret = __list_lru_walk_one(lru, nid, memcg_cache_id(memcg), - isolate, cb_arg, nr_to_walk); + ret = __list_lru_walk_one(nlru, memcg_cache_id(memcg), isolate, cb_arg, + nr_to_walk); spin_unlock(&nlru->lock); return ret; } @@ -304,8 +303,9 @@ unsigned long list_lru_walk_node(struct list_lru *lru, int nid, struct list_lru_node *nlru = &lru->node[nid]; spin_lock(&nlru->lock); - isolated += __list_lru_walk_one(lru, nid, memcg_idx, - isolate, cb_arg, nr_to_walk); + isolated += __list_lru_walk_one(nlru, memcg_idx, + isolate, cb_arg, + nr_to_walk); spin_unlock(&nlru->lock); if (*nr_to_walk <= 0)