From patchwork Thu Mar 14 05:31:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 10852161 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 773D51575 for ; Thu, 14 Mar 2019 05:32:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62B4F2A186 for ; Thu, 14 Mar 2019 05:32:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56B332A188; Thu, 14 Mar 2019 05:32:14 +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,DKIM_SIGNED, DKIM_VALID,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 D6AEF2A186 for ; Thu, 14 Mar 2019 05:32:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3492C8E0004; Thu, 14 Mar 2019 01:32:10 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2D1D18E0001; Thu, 14 Mar 2019 01:32:10 -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 14BAD8E0004; Thu, 14 Mar 2019 01:32:10 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by kanga.kvack.org (Postfix) with ESMTP id DBD1B8E0001 for ; Thu, 14 Mar 2019 01:32:09 -0400 (EDT) Received: by mail-qt1-f200.google.com with SMTP id y12so4317523qti.4 for ; Wed, 13 Mar 2019 22:32:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=D6RBo2xA005T3vgh61b+8gQHpH8S5KLC0eS56YqC/3o=; b=KCL7rLXYANTHp91oVLpJwH8r7fXOXUnKBK0LfV42vEnQgZOCnmsRdBDAdyVbgD1RpZ nWSav+H3gm9FwASvd2gG2V62gRTNhNzv01w2zZd/AmX4otNNNFYPS56NInsIf+/fvU0J 1QIqiuJbwKV66JOzOBRsaGvyNCBaJvw6ALrwOhLqiKnHYKMzh3n/MH+eK11NBJXUvoJN unHAH6tO31H0AhAQP0qR0599J/FBt65buGYNXvoGrJL9u6bgAXZpK2tF77dGf0O1U/DE SrUVY1ejy8KjXX/db+T0APuwXWw+K2Cnk3P/QukIb5vhE9L6AgZnaJQD+AgkrnF+6ws9 5Rmg== X-Gm-Message-State: APjAAAU/TtzTuBrXpenRh+SI6dDVni79mHkuhriPaNz2qSiXiXsljQMS grT4IEqEB7pQx0G/CH6TyCzdT7rmAGrEeIlvtMw9l/sNfKHRGCflViLqQCnavJXxKBH8N1sAwD2 /tFHnFuJ1ixJn8teFLpdFusRFXMSm5LWpDpZXxasin+1NgP8CYhtHdu/QjyfMYkw= X-Received: by 2002:a37:4dd0:: with SMTP id a199mr35511332qkb.318.1552541529646; Wed, 13 Mar 2019 22:32:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzdEUyKDydUFzLdYuduP8pPOy4aaUPhMV+TpM1VkTxpYq2EjCtWcdp8va77DA+3YMzmKtg X-Received: by 2002:a37:4dd0:: with SMTP id a199mr35511299qkb.318.1552541528976; Wed, 13 Mar 2019 22:32:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552541528; cv=none; d=google.com; s=arc-20160816; b=DkcAFb6QHCNYsOi8Wr95iPQhZd/p4jlkteGAQy4c3MxsPShQslZIVCcK4XFaKqV2tX jNlw2XqpjKRiNyr2/6TnNUSSKzpNP/SPU3S6Clx2lQC2T4svfy8O4BW4LswIAMYh2/l8 tcDuuA7l3LHVQ7ZMRqKpKrLdT1FsnD8ZS9qWVSEkxOcXaMCRBWegf79h6cNOpPpf1BK4 8otmTrwB3QrmeCLLD60osBuiUolkW3LnjW/2zioOzqwnVbDj2sxxdXbo7XbDHjE0voET /jlor3EJVqaaTI1elPoJ8XNEolrjITEILI33RljcQcYSRMLtsdqG1MMLzZheWbN3FEkW OAJQ== 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:dkim-signature; bh=D6RBo2xA005T3vgh61b+8gQHpH8S5KLC0eS56YqC/3o=; b=0/ALFaqvrRhTDKqmF52ipgg7nocS5bWJgVhDWGOd2g44UrqYqVsbQyiBUrtKG9cGuh SrnbXT/fMpen+l0FuAxHe/jQifrsXCOFiaYKErxPda2WIXz2kUPw18a0Ya46Az4JGRa3 4Ny7J7dItS8DcHeiGeu/euIEj5hHkUckCoRMujYj5EZPUYxsKGN9luHPm3Wl6jxAW7os A+q2Qxsw8xKs+iZuOCsMkaGBRQQm7Ak1XQ5pNLK4xuEJCD4GQHW+HcCocrJ3FdsNkauu F39iefF2Cj7QgNKO8kpxV9v6wC3zKSErMx1M1piS0qbT/A/GKNAUiVfkUpiFEP/2JyH0 Y6YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=jokTLtgM; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com. [66.111.4.26]) by mx.google.com with ESMTPS id g63si9163971qkg.261.2019.03.13.22.32.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 22:32:08 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) client-ip=66.111.4.26; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=jokTLtgM; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 9482621550; Thu, 14 Mar 2019 01:32:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 14 Mar 2019 01:32:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=D6RBo2xA005T3vgh61b+8gQHpH8S5KLC0eS56YqC/3o=; b=jokTLtgM Pw26V8ZDtMnDR0czqO17EIIcwvEW/JO0xXkBcGUhyIw+0oppZVFCW8NduwfH/UeT 1zQvwPnzk8HwOk5PMEqWQZjm06otbVy4h42L25gnq4mFk35xBjibdPCPvVFbeHTl n8gfNwLz8mjdCZNblYO1EX3wWWe5vmHY1Qm8cXV27ox/rjwGDt7or3jiSBcPSB0E eZSu1ne352wvggS7swjQ23vKAR0wJY2+ode7jQ/hhXFQd4Ub6L5o3kv463FjfzIt v+I3lwVjurRoQ5Zt+PwXLQxloGGAJTnCk+lfUvNXI95APCINQjM1mhfwqWtRNkFU bDPAdWQ2KV943w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrhedugdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepfdfvohgsihhn ucevrdcujfgrrhguihhnghdfuceothhosghinheskhgvrhhnvghlrdhorhhgqeenucfkph epuddvgedrudeiledrvdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehtohgs ihhnsehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from eros.localdomain (124-169-23-184.dyn.iinet.net.au [124.169.23.184]) by mail.messagingengine.com (Postfix) with ESMTPA id E4137E41BB; Thu, 14 Mar 2019 01:32:04 -0400 (EDT) From: "Tobin C. Harding" To: Andrew Morton Cc: "Tobin C. Harding" , Roman Gushchin , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/7] list: Add function list_rotate_to_front() Date: Thu, 14 Mar 2019 16:31:29 +1100 Message-Id: <20190314053135.1541-2-tobin@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190314053135.1541-1-tobin@kernel.org> References: <20190314053135.1541-1-tobin@kernel.org> 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 Currently if we wish to rotate a list until a specific item is at the front of the list we can call list_move_tail(head, list). Note that the arguments are the reverse way to the usual use of list_move_tail(list, head). This is a hack, it depends on the developer knowing how the list_head operates internally which violates the layer of abstraction offered by the list_head. Also, it is not intuitive so the next developer to come along must study list.h in order to fully understand what is meant by the call, while this is 'good for' the developer it makes reading the code harder. We should have an function appropriately named that does this if there are users for it intree. By grep'ing the tree for list_move_tail() and list_tail() and attempting to guess the argument order from the names it seems there is only one place currently in the tree that does this - the slob allocatator. Add function list_rotate_to_front() to rotate a list until the specified item is at the front of the list. Signed-off-by: Tobin C. Harding --- include/linux/list.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/linux/list.h b/include/linux/list.h index 79626b5ab36c..8ead813e7f1c 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -270,6 +270,24 @@ static inline void list_rotate_left(struct list_head *head) } } +/** + * list_rotate_to_front() - Rotate list to specific item. + * @list: The desired new front of the list. + * @head: The head of the list. + * + * Rotates list so that @list becomes the new front of the list. + */ +static inline void list_rotate_to_front(struct list_head *list, + struct list_head *head) +{ + /* + * Deletes the list head from the list denoted by @head and + * places it as the tail of @list, this effectively rotates the + * list so that @list is at the front. + */ + list_move_tail(head, list); +} + /** * list_is_singular - tests whether a list has just one entry. * @head: the list to test. From patchwork Thu Mar 14 05:31:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 10852163 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51E2E1390 for ; Thu, 14 Mar 2019 05:32:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3ED8A2A1A3 for ; Thu, 14 Mar 2019 05:32:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 334BD2A1B2; Thu, 14 Mar 2019 05:32:17 +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,DKIM_SIGNED, DKIM_VALID,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 AF39C2A1A8 for ; Thu, 14 Mar 2019 05:32:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 595688E0005; Thu, 14 Mar 2019 01:32:14 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 520368E0001; Thu, 14 Mar 2019 01:32:14 -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 39B4E8E0005; Thu, 14 Mar 2019 01:32:14 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by kanga.kvack.org (Postfix) with ESMTP id 0C8318E0001 for ; Thu, 14 Mar 2019 01:32:14 -0400 (EDT) Received: by mail-qt1-f200.google.com with SMTP id q12so1267908qtr.3 for ; Wed, 13 Mar 2019 22:32:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=sj6M4OpXGBRvDdAJeVq0+fK1eLMRQBJtoq/YI75189Q=; b=r1OWAg3zRqgvk+yry6cT0b//1LcPLrhugNtTQOsGvhdk62l6dY91YKfpRNUUJGwsS8 yRIzvRHcFlZ0niwXi6TF7UPohgrZWrow8hYpmIFDYx6E5qUpnG4uI0UtsPbQFRZu6S5P KU1FaMwdRu3GrBH5g0uTWQc3MQRebJyoey8YsUyoyp4ZwNjBh5MdEMUnskr2Mc7IHDUb 0KHydEZKj8DJxG8HL1+aR5LohxWBH5OhnKt9/9z1XI7qNH8O1oYkuXPyF4Ja6SU/i5g1 SywYhEQpDjm3OkKxBvcKlTsIFdVWVpMqCyrj6eqsprxQrr/kCCigksMh4lOkSwoCuKbL ZTcQ== X-Gm-Message-State: APjAAAXM0/GNe6GkX5O2szvrL6pud77lSLYtyShN4pc+zNyctIUz3Es3 hewjMZB9cAWC72URFWMTxLLB1za5W04g5CtnnT7ur6GqhxwJ6o3Hn6RONQDdNr8i7FK5Fzt8mqt OibBSwOL0fiaOFja2cx4dKKr/ctzkXEnXH22ZK1NmlSVTRBW311snH4ZGoDlXZ68= X-Received: by 2002:ac8:1be6:: with SMTP id m35mr14490248qtk.258.1552541533843; Wed, 13 Mar 2019 22:32:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4SDK+kFUiHgSfrtyLeZ3nquANOksA1u6iqlSQ5yi+DOpfFVqhqoCnUrXcX3iorP7Ieya3 X-Received: by 2002:ac8:1be6:: with SMTP id m35mr14490219qtk.258.1552541533120; Wed, 13 Mar 2019 22:32:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552541533; cv=none; d=google.com; s=arc-20160816; b=y2wOfEXTUn9wXvL16RgI6JjFY/3G4s4ZFD3JMVUC4WAI5hoF9vJ0nW8nSNl5J4Tyyt OZ3MIUmziiHSiR2SX06/jyupxNgMV1TmYbmNqG/TTVFDG5hUq5fyMWSyP5l/tiFJxzzE dxMBoPoum/V4dShwAp4AUpVnAPvj5gOo6uNeCNqxllN3RePjGnbBhHNwNRoW+v6tFRFF gHN9+vkg17CH7FFHalYr0ejSDtODRZZ2mqbLFsi1hO17Ub+qV7vMEoHqAB2PPT35MuM7 nCNlj+bhaoDvi//Pq9szelGInJxaU0sW49YnZL72sq8OM9gABUa07WSHQ5lb5ScruK/w vbpg== 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:dkim-signature; bh=sj6M4OpXGBRvDdAJeVq0+fK1eLMRQBJtoq/YI75189Q=; b=SNqGl4Eh35wbZUe2ZAQalrvKmykjpU3NOsCY0DhKebpihpw0m4QzxvpCEtFIf9+EfU +/7VV2QUhzEBa7h9RjwqHYOQIJK3xhneFbCUfkZnV8Ida9nQ89pDH84PDi+pQKgxs9rO 3+s0MwtCNbnSxGvLdXq1ealupJNNRURmjdRjZdIMh5CCgp8o19F0N+eO9oEwuwQ5x7JV U3/SSXCxMR5uls4n3AylkDZZAI3/kcUv+4O9HpHOgACqiutBPXfVDlBWspJH+IB2HEsg +KlKI/iNgTIYFA5RXJill6nOJMV3Q8lqC2kNv+s3sC9iPXvA4pqjLj7Xmm1ZIQ7UYwef cQww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=TSUpdgdJ; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com. [66.111.4.26]) by mx.google.com with ESMTPS id d131si473464qka.201.2019.03.13.22.32.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 22:32:13 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) client-ip=66.111.4.26; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=TSUpdgdJ; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id D451E214E0; Thu, 14 Mar 2019 01:32:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 14 Mar 2019 01:32:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=sj6M4OpXGBRvDdAJeVq0+fK1eLMRQBJtoq/YI75189Q=; b=TSUpdgdJ U3GaOh+0VR06/UhiUqmiX9hT+6ZjnnXKAd/Js9+MTL0QgE1EHJdHHK2qiVbaKqz+ 9x/aceEGdIi5Zx7jY0XgDwspMLIXFwIfN1fCI7XImr8D9a9K4ZgsSYi77c6i93+6 Ne30IQLGZ8vdDHvEYK2BFfQdGZwgvVs5UcGp5qQiiRecuE5qAvK/2pzWolFGTbAV oA8l06zPSt2HkHj8SJDWOqf0noK8QjPFzw49MmzYcV8mYQbEBBVmWD78jWlTCCk8 TOwjKGiJ38u6yR/RusWV0dMP7X6q7SW4jHeHuNRv10Dyv9UXLraivrZe7fksUEAL RbDhew6o9XGaLw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrhedugdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepfdfvohgsihhn ucevrdcujfgrrhguihhnghdfuceothhosghinheskhgvrhhnvghlrdhorhhgqeenucfkph epuddvgedrudeiledrvdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehtohgs ihhnsehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpedu X-ME-Proxy: Received: from eros.localdomain (124-169-23-184.dyn.iinet.net.au [124.169.23.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 43937E415C; Thu, 14 Mar 2019 01:32:08 -0400 (EDT) From: "Tobin C. Harding" To: Andrew Morton Cc: "Tobin C. Harding" , Roman Gushchin , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/7] slob: Respect list_head abstraction layer Date: Thu, 14 Mar 2019 16:31:30 +1100 Message-Id: <20190314053135.1541-3-tobin@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190314053135.1541-1-tobin@kernel.org> References: <20190314053135.1541-1-tobin@kernel.org> 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 Currently we reach inside the list_head. This is a violation of the layer of abstraction provided by the list_head. It makes the code fragile. More importantly it makes the code wicked hard to understand. The code logic is based on the page in which an allocation was made, we want to modify the slob_list we are working on to have this page at the front. We already have a function to check if an entry is at the front of the list. Recently a function was added to list.h to do the list rotation. We can use these two functions to reduce line count, reduce code fragility, and reduce cognitive load required to read the code. Use list_head functions to interact with lists thereby maintaining the abstraction provided by the list_head structure. Signed-off-by: Tobin C. Harding --- I verified the comment pointing to Knuth, the page number may be out of date but with this comment I was able to find the text that discusses this, left the comment as is (after fixing style). mm/slob.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/mm/slob.c b/mm/slob.c index 307c2c9feb44..39ad9217ffea 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -268,8 +268,7 @@ static void *slob_page_alloc(struct page *sp, size_t size, int align) */ static void *slob_alloc(size_t size, gfp_t gfp, int align, int node) { - struct page *sp; - struct list_head *prev; + struct page *sp, *prev, *next; struct list_head *slob_list; slob_t *b = NULL; unsigned long flags; @@ -296,18 +295,27 @@ static void *slob_alloc(size_t size, gfp_t gfp, int align, int node) if (sp->units < SLOB_UNITS(size)) continue; + /* + * Cache previous entry because slob_page_alloc() may + * remove sp from slob_list. + */ + prev = list_prev_entry(sp, lru); + /* Attempt to alloc */ - prev = sp->lru.prev; b = slob_page_alloc(sp, size, align); if (!b) continue; - /* Improve fragment distribution and reduce our average + next = list_next_entry(prev, lru); /* This may or may not be sp */ + + /* + * Improve fragment distribution and reduce our average * search time by starting our next search here. (see - * Knuth vol 1, sec 2.5, pg 449) */ - if (prev != slob_list->prev && - slob_list->next != prev->next) - list_move_tail(slob_list, prev->next); + * Knuth vol 1, sec 2.5, pg 449) + */ + if (!list_is_first(&next->lru, slob_list)) + list_rotate_to_front(&next->lru, slob_list); + break; } spin_unlock_irqrestore(&slob_lock, flags); From patchwork Thu Mar 14 05:31:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 10852165 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A78B61575 for ; Thu, 14 Mar 2019 05:32:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 959E72A1A1 for ; Thu, 14 Mar 2019 05:32:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89AED2A1B6; Thu, 14 Mar 2019 05:32:20 +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,DKIM_SIGNED, DKIM_VALID,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 0E8452A1A9 for ; Thu, 14 Mar 2019 05:32:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D0F398E0006; Thu, 14 Mar 2019 01:32:18 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C96AC8E0001; Thu, 14 Mar 2019 01:32:18 -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 AE8C18E0006; Thu, 14 Mar 2019 01:32:18 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by kanga.kvack.org (Postfix) with ESMTP id 7D9898E0001 for ; Thu, 14 Mar 2019 01:32:18 -0400 (EDT) Received: by mail-qt1-f199.google.com with SMTP id s8so4235337qth.18 for ; Wed, 13 Mar 2019 22:32:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=2eN7lydm96kcUslXdltVZiRHDPn/FxigSb7w12z8+Ik=; b=LfZeRSoIO2UhUxgsFnVLioFVO9U4P1uqOaggfcxJFuDJEkVYnGShSJhXbqeCWyB1eq fT/V4N2+lUUqdLnfSVmAE/3IAqFgEz7c9S8ooEDYfwC5OPR23g89woi7h2qLPGmZfJEP OUnQG6wLCBVce36q17LWYEv66GqB2diDy4RQXESVtxf62ZQOJTZ6HOrwaurowM+UY3yI /l9EXV9T4g8ESYV2irx/ZF0V4KnxJdoA5JPpw+45PVR8+PMdafmUB5MlfE2vdCmZwWFM noXy1Be2VUurAvybb2RJVkv89QPBFJn0GotJzClF7hMBWbXoaoLGLXCgI5fldphfX1Qo iJpg== X-Gm-Message-State: APjAAAVRNtFwr4adh2tYYUjmu6/yLLsA/Z1A9hx9OI4kaSjgb511wZ+e /iYSKehvng5BC0o1TkzKFhs246tYKzAOjTTU+qZlcbpELAAwV/bgnxERFe8WGRwDPtLTmoO5Xut 8zZZZFNi2iF68T+DFLDztr+QeWloEM+bOXvLPj3CKvXTNMZK/tDItHPgF1McrgWo= X-Received: by 2002:a37:4887:: with SMTP id v129mr36963536qka.100.1552541538279; Wed, 13 Mar 2019 22:32:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZOS6Xdl4laGRZ2+c/aWSl+7x5fjriyswGvmziIiFU1R58AfFy54n/fyTZuRBGbTQx4eC0 X-Received: by 2002:a37:4887:: with SMTP id v129mr36963494qka.100.1552541537070; Wed, 13 Mar 2019 22:32:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552541537; cv=none; d=google.com; s=arc-20160816; b=XelfduTVWo0xobeVTwc+R5IySIfpp0JRd1o/QwrMtEu4QsvqxwPO0AEeCyAFUVZK6N D1xcdzw/NAfgiS1GtnVBpc+/oRAZNiDWyozg+HU5Hta0UeC1+oCiHPlCIjSutKGG7byn xInHEYkGMx7vydxluR5fTq30JmYJZwFDT/us0tfaGwy8P2NMCfYpJ63AzROD9ECsyy1R olQgK94f8MxO/+GmmvJZSP5L5+OYuemFu7YbPFvwTPmA4KTM6jqRSDHP0NI2eK2l3D/S J5sLxMkzU2qSEl6SlHWJnMCmEbejP98UuFnN9mD9OQsEke47weNgwUEbSyZR45z5d+Wk 6BZg== 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:dkim-signature; bh=2eN7lydm96kcUslXdltVZiRHDPn/FxigSb7w12z8+Ik=; b=qThHasFaJlygbjXW+ARDRsn0dfhvwVedNouogLyAXxzZTfkhsHhgL8uYc4IN94nSr3 HKuYV4c4U4kABF+ZbeyKp2smCY15FLxVigbT04AckJVVoNudIY0DmxjNfu03iI6qALOw d1yJDAncUNntTwfrdzR3nBB+OgR3O5aUGjHnt6CKh9q6n7AU2ZZfW3uud16t1AZSYeRn NtbuDUkHsWvIoybKmngLWqJDKR5bTSLaegKbiPmpwItETZhdFdCXTw24RadnbCBG3Qbx zG4oUkZ+ugyS3JpjaqxZp8At4RPKCnvrlUy93dx4RHyo3YMbtLWir6tXLE6atYw1k9BK 1MLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=FTUT+ROK; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com. [66.111.4.26]) by mx.google.com with ESMTPS id n89si1018945qte.53.2019.03.13.22.32.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 22:32:17 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) client-ip=66.111.4.26; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=FTUT+ROK; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id B4D962073F; Thu, 14 Mar 2019 01:32:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 14 Mar 2019 01:32:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=2eN7lydm96kcUslXdltVZiRHDPn/FxigSb7w12z8+Ik=; b=FTUT+ROK r7cdMFF2w62zmsE8vApTYJq9L8QrVsuNfDtT9fhKrKpLxkN2CX61Mddximwx9i1W VAISGqfybF8Ug6tna24R7iuAQx/Vc+79zTb8wKhHAy5wuL7O+IsHs6dOXD0Aejy2 352XtRpl7RUevrbaK1t2IcqyTeBaP3N0Y06mf60HfN9SJ7NpEx6Y+1z+WUEZgPn1 p910s13PA3qc2/26aw4YACDhrbpkHIOdkMZJZxidWQ/w/sudwK4sPmnhrGoUea3i 70/Tw9nxOXh21VGK2PLrFpYbogNU4zvCCl0xDSsouLB+urfyJZ2XW4JvPKwZllVf y+WLfpABG0V1OA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrhedugdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepfdfvohgsihhn ucevrdcujfgrrhguihhnghdfuceothhosghinheskhgvrhhnvghlrdhorhhgqeenucfkph epuddvgedrudeiledrvdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehtohgs ihhnsehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpedv X-ME-Proxy: Received: from eros.localdomain (124-169-23-184.dyn.iinet.net.au [124.169.23.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 28FD1E415C; Thu, 14 Mar 2019 01:32:12 -0400 (EDT) From: "Tobin C. Harding" To: Andrew Morton Cc: "Tobin C. Harding" , Roman Gushchin , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/7] slob: Use slab_list instead of lru Date: Thu, 14 Mar 2019 16:31:31 +1100 Message-Id: <20190314053135.1541-4-tobin@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190314053135.1541-1-tobin@kernel.org> References: <20190314053135.1541-1-tobin@kernel.org> 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 Currently we use the page->lru list for maintaining lists of slabs. We have a list_head in the page structure (slab_list) that can be used for this purpose. Doing so makes the code cleaner since we are not overloading the lru list. The slab_list is part of a union within the page struct (included here stripped down): union { struct { /* Page cache and anonymous pages */ struct list_head lru; ... }; struct { dma_addr_t dma_addr; }; struct { /* slab, slob and slub */ union { struct list_head slab_list; struct { /* Partial pages */ struct page *next; int pages; /* Nr of pages left */ int pobjects; /* Approximate count */ }; }; ... Here we see that slab_list and lru are the same bits. We can verify that this change is safe to do by examining the object file produced from slob.c before and after this patch is applied. Steps taken to verify: 1. checkout current tip of Linus' tree commit a667cb7a94d4 ("Merge branch 'akpm' (patches from Andrew)") 2. configure and build (select SLOB allocator) CONFIG_SLOB=y CONFIG_SLAB_MERGE_DEFAULT=y 3. dissasemble object file `objdump -dr mm/slub.o > before.s 4. apply patch 5. build 6. dissasemble object file `objdump -dr mm/slub.o > after.s 7. diff before.s after.s Use slab_list list_head instead of the lru list_head for maintaining lists of slabs. Reviewed-by: Roman Gushchin Signed-off-by: Tobin C. Harding --- mm/slob.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/slob.c b/mm/slob.c index 39ad9217ffea..94486c32e0ff 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -112,13 +112,13 @@ static inline int slob_page_free(struct page *sp) static void set_slob_page_free(struct page *sp, struct list_head *list) { - list_add(&sp->lru, list); + list_add(&sp->slab_list, list); __SetPageSlobFree(sp); } static inline void clear_slob_page_free(struct page *sp) { - list_del(&sp->lru); + list_del(&sp->slab_list); __ClearPageSlobFree(sp); } @@ -282,7 +282,7 @@ static void *slob_alloc(size_t size, gfp_t gfp, int align, int node) spin_lock_irqsave(&slob_lock, flags); /* Iterate through each partially free page, try to find room */ - list_for_each_entry(sp, slob_list, lru) { + list_for_each_entry(sp, slob_list, slab_list) { #ifdef CONFIG_NUMA /* * If there's a node specification, search for a partial @@ -331,7 +331,7 @@ static void *slob_alloc(size_t size, gfp_t gfp, int align, int node) spin_lock_irqsave(&slob_lock, flags); sp->units = SLOB_UNITS(PAGE_SIZE); sp->freelist = b; - INIT_LIST_HEAD(&sp->lru); + INIT_LIST_HEAD(&sp->slab_list); set_slob(b, SLOB_UNITS(PAGE_SIZE), b + SLOB_UNITS(PAGE_SIZE)); set_slob_page_free(sp, slob_list); b = slob_page_alloc(sp, size, align); From patchwork Thu Mar 14 05:31:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 10852167 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7F4AA1575 for ; Thu, 14 Mar 2019 05:32:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6704B2A18F for ; Thu, 14 Mar 2019 05:32:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B13D2A188; Thu, 14 Mar 2019 05:32:26 +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,DKIM_SIGNED, DKIM_VALID,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 CBEA22A18F for ; Thu, 14 Mar 2019 05:32:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C23F78E0007; Thu, 14 Mar 2019 01:32:24 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BACCA8E0001; Thu, 14 Mar 2019 01:32:24 -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 A4CE98E0007; Thu, 14 Mar 2019 01:32:24 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by kanga.kvack.org (Postfix) with ESMTP id 781258E0001 for ; Thu, 14 Mar 2019 01:32:24 -0400 (EDT) Received: by mail-qt1-f200.google.com with SMTP id p40so4278293qtb.10 for ; Wed, 13 Mar 2019 22:32:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=nG4agUcLr3gug1FP86NJDoqRG2ICgfrBSTTX0F15CjU=; b=cn/kQvFcGSqLfQwWh13aGbhQDA3RfdTxGaa0OTn11haMmjiHMjbcJE3Fs0jrPBkT1h qd4HQ/RaZkzq04R4DuOT9Fn5TKBQpiLft+n1z7rusEBHrBhEXpNNhmBXj/UpD1w5gQn8 UNBh+KI0bztxU+aDtb9DRIq3VezgPH+qBl+8xBXphVrIUuq5cHpYnqLZoPgd+8pL0Mlo 22i8LWk/PPMvXplIFiUWpFvkC59RrXinXjjzWcl5cKIBxBm5xX0Wew3nVtqMWTvi5nkq BIHDeEsacVeAFmLJLPgzQ8rsWlOLjwZHgwdoELwrqbWcdGcgag2G+n+XU3KGp/UNm8/s dgUA== X-Gm-Message-State: APjAAAUL/3PoBA5iMNnLbIZ0x2g59+RJaKhG0GWpvzV8E+VaH5PVHOSb gKjSXycDJ3qSZXCV4R0ufzsV6cn8egv9hP8Bkxa7DK3nOKg0pALYeAcqce5DYFHoWbp+h3hTU4I 2UTD4niaSlVaHy54bYfidEzdlJWkZw6pnB0J318q0Bw/37S/xvZPS5C88PSyAenM= X-Received: by 2002:a0c:d121:: with SMTP id a30mr38706087qvh.0.1552541544280; Wed, 13 Mar 2019 22:32:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwChOW4ZNEhDYiyjdVIjwe2spIZUxIlWs2Chjs83LwGRSkaX0Bl/Dh+uUlbXWUy9UNwcxIl X-Received: by 2002:a0c:d121:: with SMTP id a30mr38706045qvh.0.1552541543070; Wed, 13 Mar 2019 22:32:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552541543; cv=none; d=google.com; s=arc-20160816; b=z4DXTrVdMu00L5xEuQzOSfS7jhjx/dwKcmDPg1d3fvfwbi2zUNdqoqJBdVo7E6M1Sj IqEhADuI0B4v1Ck7T3JJsTaI79o2j+OjavIPUON3QEI2jDYIZxOwjetYklSOTGIbz+e9 Pc1o2VXwqHePxOIeP/Vd2OrgEn3FZQ8gpDh2+fA5rWkCbeu0PV20sVTfhkCOT1rT7tZ4 +2Ei1Bj21l8StTHZVRv/gYuTtGSaJVwOLMPZIC8fkVVOTGAwN/rjTj1EAdRmP+rZjXb3 ZVqRZkpyccPYqCXbx4qILPXYAL/XMUsRn/QVWI8bXjbMx0WHE3kjUpnO3Ezr93yd6WWf AUQg== 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:dkim-signature; bh=nG4agUcLr3gug1FP86NJDoqRG2ICgfrBSTTX0F15CjU=; b=pcIq+DTVwI/TTxI9X8ukzHZBtt7xKg6wJ6/npIAAQmDceRdAjLZXKF7j7ggp6VOKfz ck+c+yW8vm75Gq79ruIrC/qMqq20YQxYkIxmfzoBBVzdjD6ADaeRsIgT/2LNjS0D87gy k9pxvP9Mfl/7hy8XU1NqHFHaNeynxO9rtdR5OWf5gLcOqqJ+Hc0UY4tak79GVbrNrOug 8l3h9Ma94tS8IxZfWFuLg3aRQVn+Qe7xKlzhNg/LPDjGiSi9fWlIQsLie+R1ddt/maON xnGJLXmP1dJGyYe34AJLvmXvbNqZ2enPDWqzgueHQPlfJZXZuU8oUqlL2I0+2MY2gZDf P2QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=m9UUtS1G; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com. [66.111.4.26]) by mx.google.com with ESMTPS id c10si3807900qvo.164.2019.03.13.22.32.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 22:32:23 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) client-ip=66.111.4.26; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=m9UUtS1G; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 33514211D3; Thu, 14 Mar 2019 01:32:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 14 Mar 2019 01:32:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=nG4agUcLr3gug1FP86NJDoqRG2ICgfrBSTTX0F15CjU=; b=m9UUtS1G 40FHBT/D9O6JXELA1BCp6O4Sluhh7mUEhII+Ba5sMV5CBy+n9/REazHlR5r1hcTl fQuwdgisFb6XgDVU4O7WaugvbfvdGUBlIPlw7utDbAmqcDe/ZpiImtHci4EqqV0E vParUzUOU4cnnep2FaTm0LAQ+tje32yLG9CIa44pUI/zwyXErnPsogmqRg4nAoFu as37G4O3gF8YkGOQ0wMJLYk9M29oSBUVMMvLie6Pxxpc4SOuUAboTMo7XxYwLhVA kgW+f/GN1meV20+I1YgD+KGxEYhiVyLwFFs8NhtyfNyFxNSzZbmcum9h1WzjcGBY M9aPyGrppSPzqw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrhedugdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepfdfvohgsihhn ucevrdcujfgrrhguihhnghdfuceothhosghinheskhgvrhhnvghlrdhorhhgqeenucfkph epuddvgedrudeiledrvdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehtohgs ihhnsehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpeef X-ME-Proxy: Received: from eros.localdomain (124-169-23-184.dyn.iinet.net.au [124.169.23.184]) by mail.messagingengine.com (Postfix) with ESMTPA id D4004E408B; Thu, 14 Mar 2019 01:32:17 -0400 (EDT) From: "Tobin C. Harding" To: Andrew Morton Cc: "Tobin C. Harding" , Roman Gushchin , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/7] slub: Add comments to endif pre-processor macros Date: Thu, 14 Mar 2019 16:31:32 +1100 Message-Id: <20190314053135.1541-5-tobin@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190314053135.1541-1-tobin@kernel.org> References: <20190314053135.1541-1-tobin@kernel.org> 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 SLUB allocator makes heavy use of ifdef/endif pre-processor macros. The pairing of these statements is at times hard to follow e.g. if the pair are further than a screen apart or if there are nested pairs. We can reduce cognitive load by adding a comment to the endif statement of form #ifdef CONFIG_FOO ... #endif /* CONFIG_FOO */ Add comments to endif pre-processor macros if ifdef/endif pair is not immediately apparent. Reviewed-by: Roman Gushchin Acked-by: Christoph Lameter Signed-off-by: Tobin C. Harding --- mm/slub.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 1b08fbcb7e61..b282e22885cd 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1951,7 +1951,7 @@ static void *get_any_partial(struct kmem_cache *s, gfp_t flags, } } } while (read_mems_allowed_retry(cpuset_mems_cookie)); -#endif +#endif /* CONFIG_NUMA */ return NULL; } @@ -2249,7 +2249,7 @@ static void unfreeze_partials(struct kmem_cache *s, discard_slab(s, page); stat(s, FREE_SLAB); } -#endif +#endif /* CONFIG_SLUB_CPU_PARTIAL */ } /* @@ -2308,7 +2308,7 @@ static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain) local_irq_restore(flags); } preempt_enable(); -#endif +#endif /* CONFIG_SLUB_CPU_PARTIAL */ } static inline void flush_slab(struct kmem_cache *s, struct kmem_cache_cpu *c) @@ -2813,7 +2813,7 @@ void *kmem_cache_alloc_node_trace(struct kmem_cache *s, } EXPORT_SYMBOL(kmem_cache_alloc_node_trace); #endif -#endif +#endif /* CONFIG_NUMA */ /* * Slow path handling. This may still be called frequently since objects @@ -3845,7 +3845,7 @@ void *__kmalloc_node(size_t size, gfp_t flags, int node) return ret; } EXPORT_SYMBOL(__kmalloc_node); -#endif +#endif /* CONFIG_NUMA */ #ifdef CONFIG_HARDENED_USERCOPY /* @@ -4063,7 +4063,7 @@ void __kmemcg_cache_deactivate(struct kmem_cache *s) */ slab_deactivate_memcg_cache_rcu_sched(s, kmemcg_cache_deact_after_rcu); } -#endif +#endif /* CONFIG_MEMCG */ static int slab_mem_going_offline_callback(void *arg) { @@ -4696,7 +4696,7 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf, "No data\n"); return len; } -#endif +#endif /* CONFIG_SLUB_DEBUG */ #ifdef SLUB_RESILIENCY_TEST static void __init resiliency_test(void) @@ -4756,7 +4756,7 @@ static void __init resiliency_test(void) #ifdef CONFIG_SYSFS static void resiliency_test(void) {}; #endif -#endif +#endif /* SLUB_RESILIENCY_TEST */ #ifdef CONFIG_SYSFS enum slab_stat_type { @@ -5413,7 +5413,7 @@ STAT_ATTR(CPU_PARTIAL_ALLOC, cpu_partial_alloc); STAT_ATTR(CPU_PARTIAL_FREE, cpu_partial_free); STAT_ATTR(CPU_PARTIAL_NODE, cpu_partial_node); STAT_ATTR(CPU_PARTIAL_DRAIN, cpu_partial_drain); -#endif +#endif /* CONFIG_SLUB_STATS */ static struct attribute *slab_attrs[] = { &slab_size_attr.attr, @@ -5614,7 +5614,7 @@ static void memcg_propagate_slab_attrs(struct kmem_cache *s) if (buffer) free_page((unsigned long)buffer); -#endif +#endif /* CONFIG_MEMCG */ } static void kmem_cache_release(struct kobject *k) From patchwork Thu Mar 14 05:31:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 10852169 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C2C61390 for ; Thu, 14 Mar 2019 05:32:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 394BA2A188 for ; Thu, 14 Mar 2019 05:32:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DF4A2A196; Thu, 14 Mar 2019 05:32:30 +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,DKIM_SIGNED, DKIM_VALID,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 74EE12A188 for ; Thu, 14 Mar 2019 05:32:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 36F6F8E0008; Thu, 14 Mar 2019 01:32:28 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2F8868E0001; Thu, 14 Mar 2019 01:32:28 -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 171B48E0008; Thu, 14 Mar 2019 01:32:28 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by kanga.kvack.org (Postfix) with ESMTP id DA7ED8E0001 for ; Thu, 14 Mar 2019 01:32:27 -0400 (EDT) Received: by mail-qk1-f198.google.com with SMTP id h28so3380440qkk.7 for ; Wed, 13 Mar 2019 22:32:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=CDYia77DvmbgSMo0ig5s08PvnjuxIbLDQT/0qMx7ZFE=; b=NJatEEgxwJVSpHkBdOUtISFegI8GpIrDWQwiMkQ/Fl/X9DJu3+4uuiUrux7GLE7AEw 3s13wtZV4qFrCPHx1vyS8NZtEaRcOgUCQ6o0HGwnGtRTj/6HSgggKBjxXuc9l/V4SOAC ZoMeXCI0qzlJShv3Mor84MAr+C3YsICHyoggCDkhXv6w3Rvn0kd9rcHesImW0krWH7ZA QKKzXFCbevawJWLm7asfKb4JsOkyrSO8qhZfgROGgSTmiZByMJUg7YyGpI9XBRMmq7cm wlXKVN996jd849IhxvfT8vObZ0PQJYvBZhM0AuqilKgCwldoBf0S+rmQKA7zHoy9rryG nhjw== X-Gm-Message-State: APjAAAXETNQ5dHAqfGLXShyLQ/yzHbPj3jwse/jZ3gN05puYv4chxBms UPt0q7KHffdmpCYr86uTFlEhjveHCJFP6PLixp1GWmJWLn+S54dDeYEpR2yl7j7Lp1yWTs6wpDU cs7SLmGMpzY+RZ9CU+wzNHjtCZjUpUd5/uAkG/IcxkmET7tCBxZh+fP4uxozW8/o= X-Received: by 2002:ac8:504c:: with SMTP id h12mr17963054qtm.208.1552541547633; Wed, 13 Mar 2019 22:32:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKvcrvczkmHiP1Z2ynRV2hj8Fcif2vs4TDHROLQuiMWXwSkxHkFzz9EaLC8XcEkuqu0HIq X-Received: by 2002:ac8:504c:: with SMTP id h12mr17963002qtm.208.1552541546303; Wed, 13 Mar 2019 22:32:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552541546; cv=none; d=google.com; s=arc-20160816; b=vu6LAmGrvuHvptwhTbQ0lWefqnlLp7Pw5qv1f1jVvE5r0xYoXOfeQnEL0FTBCRvYMK aCjomSL6ysMvUY5ixy4agMDkMPOCfs5KlZ8SdnU1Ose/OaoUx9MmpV7c+DIqyVbjFJC2 rvaclFWXYz89Kyb5hggM38RfEMOZ7NrKGI2aCHtb9K6q+mBB8RZQO5Ke8rScKsB+CL+4 nNgSfhnvR/+bYX/jrP6jUBDtF+naVqMyxA9r5UY0YQFW2ZoBfnG8fJLpvZBcpJG8Ig0X 4IAjvjEPiFy303NeqQU4OC2bu39GIZvYa0kO3++p1CoPO+S9q+QZyz0kfQpxiCB25zNF SYGA== 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:dkim-signature; bh=CDYia77DvmbgSMo0ig5s08PvnjuxIbLDQT/0qMx7ZFE=; b=F5L3jjPP6TyLA4eIXHa4GDLaUjiyQVJYDXVT1Gmr19TNvwMaHMtckKHmEPiN+Ul9VO 8lo1+CuW1c1Co67B8QZAyBPw8aIB1z/RwJ5HCbGNyHEQFBAUbKaSBfI0p8/UoOjx8fLw YkFVc9+wpfPqz9KeNLze56c7pwNGngFK83ihUWr0AirfmifxA8cg+qu+8tc/fxKVA4Vo K6TUnoYTON1HSrhHSEH+XtSRWB4aM8fmwUC1pqP98oYniQj5tk1yIhRc7YDPmG5p2j9U n1EPkstxc0E7N+PMyHL/T4wpsSkzCMKpNQKmseLTv+3rVHnJp0kPbWn0iqMiBV2GT7ls /8jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=QB7lwDAt; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com. [66.111.4.26]) by mx.google.com with ESMTPS id x10si3650929qkf.110.2019.03.13.22.32.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 22:32:26 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) client-ip=66.111.4.26; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=QB7lwDAt; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 08CC2214E0; Thu, 14 Mar 2019 01:32:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 14 Mar 2019 01:32:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=CDYia77DvmbgSMo0ig5s08PvnjuxIbLDQT/0qMx7ZFE=; b=QB7lwDAt qaYokPpKcM/8jy+xe5qQ75mWZyiWH1ykAoex1QxLI+ynOh3z9vwrRxFcLZXdxFc1 JOsNgRKpidOoAoPm8Zpf9xDBpIAZNnuZdhwoc3Kpm3NpOVs9H259Oe9RDX5g8wGD /3N06MO17idYXC/sgIn8rADeyEFppnF93UPUbchhaZe52loh8kI+dJucH0i6tLVr 70G4QqPrixhWRpBZwgapwUPUtE+F3fFNJYN7j3trb70y1oq54g7N4yEUFm5FdJw1 E3SyT0tBzEk2t5rYTSdDq4xhkNcygrqSPKOV1/XqHm5uDvE085UTYlkAseVi1PvM NDWjoFCpqchYvQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrhedugdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepfdfvohgsihhn ucevrdcujfgrrhguihhnghdfuceothhosghinheskhgvrhhnvghlrdhorhhgqeenucfkph epuddvgedrudeiledrvdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehtohgs ihhnsehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpeef X-ME-Proxy: Received: from eros.localdomain (124-169-23-184.dyn.iinet.net.au [124.169.23.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 6CB94E4482; Thu, 14 Mar 2019 01:32:22 -0400 (EDT) From: "Tobin C. Harding" To: Andrew Morton Cc: "Tobin C. Harding" , Roman Gushchin , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 5/7] slub: Use slab_list instead of lru Date: Thu, 14 Mar 2019 16:31:33 +1100 Message-Id: <20190314053135.1541-6-tobin@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190314053135.1541-1-tobin@kernel.org> References: <20190314053135.1541-1-tobin@kernel.org> 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 Currently we use the page->lru list for maintaining lists of slabs. We have a list in the page structure (slab_list) that can be used for this purpose. Doing so makes the code cleaner since we are not overloading the lru list. Use the slab_list instead of the lru list for maintaining lists of slabs. Reviewed-by: Roman Gushchin Acked-by: Christoph Lameter Signed-off-by: Tobin C. Harding --- mm/slub.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index b282e22885cd..d692b5e0163d 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1023,7 +1023,7 @@ static void add_full(struct kmem_cache *s, return; lockdep_assert_held(&n->list_lock); - list_add(&page->lru, &n->full); + list_add(&page->slab_list, &n->full); } static void remove_full(struct kmem_cache *s, struct kmem_cache_node *n, struct page *page) @@ -1032,7 +1032,7 @@ static void remove_full(struct kmem_cache *s, struct kmem_cache_node *n, struct return; lockdep_assert_held(&n->list_lock); - list_del(&page->lru); + list_del(&page->slab_list); } /* Tracking of the number of slabs for debugging purposes */ @@ -1773,9 +1773,9 @@ __add_partial(struct kmem_cache_node *n, struct page *page, int tail) { n->nr_partial++; if (tail == DEACTIVATE_TO_TAIL) - list_add_tail(&page->lru, &n->partial); + list_add_tail(&page->slab_list, &n->partial); else - list_add(&page->lru, &n->partial); + list_add(&page->slab_list, &n->partial); } static inline void add_partial(struct kmem_cache_node *n, @@ -1789,7 +1789,7 @@ static inline void remove_partial(struct kmem_cache_node *n, struct page *page) { lockdep_assert_held(&n->list_lock); - list_del(&page->lru); + list_del(&page->slab_list); n->nr_partial--; } @@ -1863,7 +1863,7 @@ static void *get_partial_node(struct kmem_cache *s, struct kmem_cache_node *n, return NULL; spin_lock(&n->list_lock); - list_for_each_entry_safe(page, page2, &n->partial, lru) { + list_for_each_entry_safe(page, page2, &n->partial, slab_list) { void *t; if (!pfmemalloc_match(page, flags)) @@ -2407,7 +2407,7 @@ static unsigned long count_partial(struct kmem_cache_node *n, struct page *page; spin_lock_irqsave(&n->list_lock, flags); - list_for_each_entry(page, &n->partial, lru) + list_for_each_entry(page, &n->partial, slab_list) x += get_count(page); spin_unlock_irqrestore(&n->list_lock, flags); return x; @@ -3702,10 +3702,10 @@ static void free_partial(struct kmem_cache *s, struct kmem_cache_node *n) BUG_ON(irqs_disabled()); spin_lock_irq(&n->list_lock); - list_for_each_entry_safe(page, h, &n->partial, lru) { + list_for_each_entry_safe(page, h, &n->partial, slab_list) { if (!page->inuse) { remove_partial(n, page); - list_add(&page->lru, &discard); + list_add(&page->slab_list, &discard); } else { list_slab_objects(s, page, "Objects remaining in %s on __kmem_cache_shutdown()"); @@ -3713,7 +3713,7 @@ static void free_partial(struct kmem_cache *s, struct kmem_cache_node *n) } spin_unlock_irq(&n->list_lock); - list_for_each_entry_safe(page, h, &discard, lru) + list_for_each_entry_safe(page, h, &discard, slab_list) discard_slab(s, page); } @@ -3993,7 +3993,7 @@ int __kmem_cache_shrink(struct kmem_cache *s) * Note that concurrent frees may occur while we hold the * list_lock. page->inuse here is the upper limit. */ - list_for_each_entry_safe(page, t, &n->partial, lru) { + list_for_each_entry_safe(page, t, &n->partial, slab_list) { int free = page->objects - page->inuse; /* Do not reread page->inuse */ @@ -4003,10 +4003,10 @@ int __kmem_cache_shrink(struct kmem_cache *s) BUG_ON(free <= 0); if (free == page->objects) { - list_move(&page->lru, &discard); + list_move(&page->slab_list, &discard); n->nr_partial--; } else if (free <= SHRINK_PROMOTE_MAX) - list_move(&page->lru, promote + free - 1); + list_move(&page->slab_list, promote + free - 1); } /* @@ -4019,7 +4019,7 @@ int __kmem_cache_shrink(struct kmem_cache *s) spin_unlock_irqrestore(&n->list_lock, flags); /* Release empty slabs */ - list_for_each_entry_safe(page, t, &discard, lru) + list_for_each_entry_safe(page, t, &discard, slab_list) discard_slab(s, page); if (slabs_node(s, node)) @@ -4211,11 +4211,11 @@ static struct kmem_cache * __init bootstrap(struct kmem_cache *static_cache) for_each_kmem_cache_node(s, node, n) { struct page *p; - list_for_each_entry(p, &n->partial, lru) + list_for_each_entry(p, &n->partial, slab_list) p->slab_cache = s; #ifdef CONFIG_SLUB_DEBUG - list_for_each_entry(p, &n->full, lru) + list_for_each_entry(p, &n->full, slab_list) p->slab_cache = s; #endif } @@ -4432,7 +4432,7 @@ static int validate_slab_node(struct kmem_cache *s, spin_lock_irqsave(&n->list_lock, flags); - list_for_each_entry(page, &n->partial, lru) { + list_for_each_entry(page, &n->partial, slab_list) { validate_slab_slab(s, page, map); count++; } @@ -4443,7 +4443,7 @@ static int validate_slab_node(struct kmem_cache *s, if (!(s->flags & SLAB_STORE_USER)) goto out; - list_for_each_entry(page, &n->full, lru) { + list_for_each_entry(page, &n->full, slab_list) { validate_slab_slab(s, page, map); count++; } @@ -4639,9 +4639,9 @@ static int list_locations(struct kmem_cache *s, char *buf, continue; spin_lock_irqsave(&n->list_lock, flags); - list_for_each_entry(page, &n->partial, lru) + list_for_each_entry(page, &n->partial, slab_list) process_slab(&t, s, page, alloc, map); - list_for_each_entry(page, &n->full, lru) + list_for_each_entry(page, &n->full, slab_list) process_slab(&t, s, page, alloc, map); spin_unlock_irqrestore(&n->list_lock, flags); } From patchwork Thu Mar 14 05:31:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 10852171 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 789B91575 for ; Thu, 14 Mar 2019 05:32:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65CF92A187 for ; Thu, 14 Mar 2019 05:32:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59A3E2A18F; Thu, 14 Mar 2019 05:32:34 +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,DKIM_SIGNED, DKIM_VALID,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 A53F52A187 for ; Thu, 14 Mar 2019 05:32:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5E2FB8E0009; Thu, 14 Mar 2019 01:32:32 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 590178E0001; Thu, 14 Mar 2019 01:32:32 -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 40B698E0009; Thu, 14 Mar 2019 01:32:32 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by kanga.kvack.org (Postfix) with ESMTP id 10F538E0001 for ; Thu, 14 Mar 2019 01:32:32 -0400 (EDT) Received: by mail-qk1-f199.google.com with SMTP id h11so3714361qkg.18 for ; Wed, 13 Mar 2019 22:32:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=1y7C0tdFU3/mxaXs9LeF2IpcwQv3uoHEyFfzQ8TmT8k=; b=BQeKkRHnKOgIVZgYDU+s4qI3UIDBDRQGlpqKNM4m1lRCLJc+neXos13ZBEXUoezpIQ ejdfv02HFIuEs1eV7IE3XC5GxMIDCALDr1xUbXxPyBcykYqAg3a9lr12CbRJLifvOMXK UlGnk3qKmTFSygkzpjsJhpES9vtbNhoYxOegHN5IdOqE2T/O62cAt/M5o51uMXlOCw8O s5OJ8zrIxhMDsG3q/RXvvW4O3c5UXZ4Nz88/Do49MkhSYVp1FLlwdYg/ITnO8ZqqMwGi 0YA74Xb9avS8AXY4unm9gmqBcG1ZK6crJP+CmQ259Fe/HKl30rOJJswweaBdabu9zWBt R3gw== X-Gm-Message-State: APjAAAW8AC8Jox61uIteqdgXam+YFCTcinQMTD8DPiDGRifSYYuu7mxs pJvA9wbCxPRusRRksqwFWZezj2oPl9DIj8pnovXsOc5OW4Hy4sY6fxBAvE1k29X4MtgJ1ftAIum rHDSjzd8VuxEgs9bw5EBB1LVSU/0qxi6Tp6No8DgcFjMkYKZV5pgey/rabe8Izcc= X-Received: by 2002:aed:3829:: with SMTP id j38mr37159836qte.385.1552541551841; Wed, 13 Mar 2019 22:32:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2eCo4bPEu4DhH1i12VEfEs/F7pK+iBIRPbQtAxQzVJTaxu8hCOr+pALBO0RNW8gMLqPsv X-Received: by 2002:aed:3829:: with SMTP id j38mr37159774qte.385.1552541550435; Wed, 13 Mar 2019 22:32:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552541550; cv=none; d=google.com; s=arc-20160816; b=YqjNipzS0GrJChlD2da6JpMTSU6OeBbH81q9X13dJMenk2vuOvv7RDtHEIoLeUefFE MqXlZU7yyFoGGSTaAkfeBcnn5uHO+26mm57n8w8ZzjJixr5/yKGNJSFbZrm6BlfBObgn RJQwTbGgmFErB2z6mr8/ywaLep7EXU//8fm5QtO7ZjWyEmqfMYUQSNo5z2swsJVEgfVj MY2cek22ZQSrjifLQ4ntwoOHC7LrVmUygXubSprOJ3gethDfKh6Q69+1vZvmluamybC7 Xf3vDAgyW+CswYdW/m/tK+QSE+ee8OurQ0eJTxvdrcVaIe8jUxBHeFRYZfks8bT5LUOc 8OaA== 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:dkim-signature; bh=1y7C0tdFU3/mxaXs9LeF2IpcwQv3uoHEyFfzQ8TmT8k=; b=fOrZcSL2TZ1xzQXueau8DI2e0nYyfllqG0pMwArOtqtzwGSe1ryA5WySSYp9B25ruI UEfYa0HkgUtyq06CHpMsCNi/GBd2QrbDJiOj82JjQQFyusU5q5K8GI5R9p51Iq1+wdhl IWBLPdghhIU1qM25+imAX+l/kmogr4BIYZ7UZyvKmI/nmBiafUAt1dZcHO1afjNtZy5L d6MTQKMnBkpqJi62ndstPVbPw/CygXGBbMKlCdiV3oMThA0NIC7cyUUQ8jARCcXsRP33 yM/f+/p2lJ7lPJAlbdhEjgPL3u0+p2NxtplZQVQ8tySar6bogWCPbTD+Tg3lJKqRQ8fF 47AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=N7vIeiZD; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com. [66.111.4.26]) by mx.google.com with ESMTPS id b30si242711qta.403.2019.03.13.22.32.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 22:32:30 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) client-ip=66.111.4.26; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=N7vIeiZD; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 31AD1213BD; Thu, 14 Mar 2019 01:32:30 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 14 Mar 2019 01:32:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=1y7C0tdFU3/mxaXs9LeF2IpcwQv3uoHEyFfzQ8TmT8k=; b=N7vIeiZD TRu7cRIuvMwTopOORGhfFmMU0vXAGra/koqnsuvMLL2Z5R2qhWkWq+10R7IavvPE buvGMcRg4152wIchozMMGg1wRktvn/oknWcAXIPrezbKR1EDd2Zs4Er2bakZ4AP3 7KzlBH6MJKFjqyOO98RhZDpHbO6EG3YenUGc8uRJ/zK8hvFXcSibNDCqirxhSp7q N79k3QtPkrQb+nZ003cT2WUPYMaOExEkDH+i0rBdCQlChoga8Il+oUgSaI30f4z2 XolnG/ALhRcd90G71D4wDE/z91kBVwwoMsvhBhNyPonZiEGM8oEPaHDiDckDqLv5 yxvYKtOA37ZQpQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrhedugdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepfdfvohgsihhn ucevrdcujfgrrhguihhnghdfuceothhosghinheskhgvrhhnvghlrdhorhhgqeenucfkph epuddvgedrudeiledrvdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehtohgs ihhnsehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpeeh X-ME-Proxy: Received: from eros.localdomain (124-169-23-184.dyn.iinet.net.au [124.169.23.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 9C007E408B; Thu, 14 Mar 2019 01:32:26 -0400 (EDT) From: "Tobin C. Harding" To: Andrew Morton Cc: "Tobin C. Harding" , Roman Gushchin , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 6/7] slab: Use slab_list instead of lru Date: Thu, 14 Mar 2019 16:31:34 +1100 Message-Id: <20190314053135.1541-7-tobin@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190314053135.1541-1-tobin@kernel.org> References: <20190314053135.1541-1-tobin@kernel.org> 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 Currently we use the page->lru list for maintaining lists of slabs. We have a list in the page structure (slab_list) that can be used for this purpose. Doing so makes the code cleaner since we are not overloading the lru list. Use the slab_list instead of the lru list for maintaining lists of slabs. Reviewed-by: Roman Gushchin Signed-off-by: Tobin C. Harding --- mm/slab.c | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/mm/slab.c b/mm/slab.c index 28652e4218e0..09cc64ef9613 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -1710,8 +1710,8 @@ static void slabs_destroy(struct kmem_cache *cachep, struct list_head *list) { struct page *page, *n; - list_for_each_entry_safe(page, n, list, lru) { - list_del(&page->lru); + list_for_each_entry_safe(page, n, list, slab_list) { + list_del(&page->slab_list); slab_destroy(cachep, page); } } @@ -2265,8 +2265,8 @@ static int drain_freelist(struct kmem_cache *cache, goto out; } - page = list_entry(p, struct page, lru); - list_del(&page->lru); + page = list_entry(p, struct page, slab_list); + list_del(&page->slab_list); n->free_slabs--; n->total_slabs--; /* @@ -2726,13 +2726,13 @@ static void cache_grow_end(struct kmem_cache *cachep, struct page *page) if (!page) return; - INIT_LIST_HEAD(&page->lru); + INIT_LIST_HEAD(&page->slab_list); n = get_node(cachep, page_to_nid(page)); spin_lock(&n->list_lock); n->total_slabs++; if (!page->active) { - list_add_tail(&page->lru, &(n->slabs_free)); + list_add_tail(&page->slab_list, &n->slabs_free); n->free_slabs++; } else fixup_slab_list(cachep, n, page, &list); @@ -2841,9 +2841,9 @@ static inline void fixup_slab_list(struct kmem_cache *cachep, void **list) { /* move slabp to correct slabp list: */ - list_del(&page->lru); + list_del(&page->slab_list); if (page->active == cachep->num) { - list_add(&page->lru, &n->slabs_full); + list_add(&page->slab_list, &n->slabs_full); if (OBJFREELIST_SLAB(cachep)) { #if DEBUG /* Poisoning will be done without holding the lock */ @@ -2857,7 +2857,7 @@ static inline void fixup_slab_list(struct kmem_cache *cachep, page->freelist = NULL; } } else - list_add(&page->lru, &n->slabs_partial); + list_add(&page->slab_list, &n->slabs_partial); } /* Try to find non-pfmemalloc slab if needed */ @@ -2880,20 +2880,20 @@ static noinline struct page *get_valid_first_slab(struct kmem_cache_node *n, } /* Move pfmemalloc slab to the end of list to speed up next search */ - list_del(&page->lru); + list_del(&page->slab_list); if (!page->active) { - list_add_tail(&page->lru, &n->slabs_free); + list_add_tail(&page->slab_list, &n->slabs_free); n->free_slabs++; } else - list_add_tail(&page->lru, &n->slabs_partial); + list_add_tail(&page->slab_list, &n->slabs_partial); - list_for_each_entry(page, &n->slabs_partial, lru) { + list_for_each_entry(page, &n->slabs_partial, slab_list) { if (!PageSlabPfmemalloc(page)) return page; } n->free_touched = 1; - list_for_each_entry(page, &n->slabs_free, lru) { + list_for_each_entry(page, &n->slabs_free, slab_list) { if (!PageSlabPfmemalloc(page)) { n->free_slabs--; return page; @@ -2908,11 +2908,12 @@ static struct page *get_first_slab(struct kmem_cache_node *n, bool pfmemalloc) struct page *page; assert_spin_locked(&n->list_lock); - page = list_first_entry_or_null(&n->slabs_partial, struct page, lru); + page = list_first_entry_or_null(&n->slabs_partial, struct page, + slab_list); if (!page) { n->free_touched = 1; page = list_first_entry_or_null(&n->slabs_free, struct page, - lru); + slab_list); if (page) n->free_slabs--; } @@ -3413,29 +3414,29 @@ static void free_block(struct kmem_cache *cachep, void **objpp, objp = objpp[i]; page = virt_to_head_page(objp); - list_del(&page->lru); + list_del(&page->slab_list); check_spinlock_acquired_node(cachep, node); slab_put_obj(cachep, page, objp); STATS_DEC_ACTIVE(cachep); /* fixup slab chains */ if (page->active == 0) { - list_add(&page->lru, &n->slabs_free); + list_add(&page->slab_list, &n->slabs_free); n->free_slabs++; } else { /* Unconditionally move a slab to the end of the * partial list on free - maximum time for the * other objects to be freed, too. */ - list_add_tail(&page->lru, &n->slabs_partial); + list_add_tail(&page->slab_list, &n->slabs_partial); } } while (n->free_objects > n->free_limit && !list_empty(&n->slabs_free)) { n->free_objects -= cachep->num; - page = list_last_entry(&n->slabs_free, struct page, lru); - list_move(&page->lru, list); + page = list_last_entry(&n->slabs_free, struct page, slab_list); + list_move(&page->slab_list, list); n->free_slabs--; n->total_slabs--; } @@ -3473,7 +3474,7 @@ static void cache_flusharray(struct kmem_cache *cachep, struct array_cache *ac) int i = 0; struct page *page; - list_for_each_entry(page, &n->slabs_free, lru) { + list_for_each_entry(page, &n->slabs_free, slab_list) { BUG_ON(page->active); i++; @@ -4336,9 +4337,9 @@ static int leaks_show(struct seq_file *m, void *p) check_irq_on(); spin_lock_irq(&n->list_lock); - list_for_each_entry(page, &n->slabs_full, lru) + list_for_each_entry(page, &n->slabs_full, slab_list) handle_slab(x, cachep, page); - list_for_each_entry(page, &n->slabs_partial, lru) + list_for_each_entry(page, &n->slabs_partial, slab_list) handle_slab(x, cachep, page); spin_unlock_irq(&n->list_lock); } From patchwork Thu Mar 14 05:31:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 10852173 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 046851575 for ; Thu, 14 Mar 2019 05:32:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4C672A186 for ; Thu, 14 Mar 2019 05:32:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D89432A188; Thu, 14 Mar 2019 05:32: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,DKIM_SIGNED, DKIM_VALID,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 5D7B12A186 for ; Thu, 14 Mar 2019 05:32:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1EBFD8E000A; Thu, 14 Mar 2019 01:32:36 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 173D38E0001; Thu, 14 Mar 2019 01:32:36 -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 F30078E000A; Thu, 14 Mar 2019 01:32:35 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by kanga.kvack.org (Postfix) with ESMTP id C35888E0001 for ; Thu, 14 Mar 2019 01:32:35 -0400 (EDT) Received: by mail-qk1-f198.google.com with SMTP id h11so3714462qkg.18 for ; Wed, 13 Mar 2019 22:32:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=x7XzuZHTX79KOo0NhHz+n2DRp/2Ctmdn2rPrkfVwAcU=; b=WogLOVLTR8l2zIOCIA1U0s8ncR+YCDH6yg+uWu8Gw8Z+hWtzmXByf/tNC3KtKLOb0J AQ22yyqrsTCwtQs0xAvaU/IpClGwBY60Jppv2kHZLzHstXse/oYpZklPOw3YZufTt+pb ZQm2flOo2dXAKu5WwKxOQzLP8+g1Zz7e3tTsH0YCPYsxCLMpTUFDj5kmry8tQ42NKg/L sdempLVVbp2Wp1CWnEKIvSe0HNTQTAyWnBearEFp5odn8+4vQgtT7NlmorrdrMNM2Et8 jN7JYsImXVGQTB34DESvlapro7tNKtbX+zxJPFW1HW1NOh4t3OvA3cWOVZpdvcVy3xiB pihg== X-Gm-Message-State: APjAAAVT8d6JDUKFIbGClGOpgBdCYrZZWUPQRSGC7bE6sfW9LVU+BZ3W x7HcTsQy5auYKAeJgy2Rpm7qZ6vKUtRkFEYeN0JSgX5XQm8ANSDtVf0Ey0P1kuFqaRaVJJKy/v7 M4Col4AoeHlu0izjZQL0xtkaF/F6gpa+U4ked/95WYJkDF4fqyLARJpwt1hdqB+c= X-Received: by 2002:a0c:ac93:: with SMTP id m19mr37199509qvc.27.1552541555608; Wed, 13 Mar 2019 22:32:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwns+EuZTm+XUuE+WYWdN11at3XXSXpU/4rwi/6iSCgDl0p9++4FZ/lpKF4Yp/Y9Sye1DYu X-Received: by 2002:a0c:ac93:: with SMTP id m19mr37199476qvc.27.1552541554648; Wed, 13 Mar 2019 22:32:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552541554; cv=none; d=google.com; s=arc-20160816; b=Xu+0fn3BSFgaDcZg2F9aVWmkbBOnHxfPwWuU9a827JQkGwseB0GaEMGbH35UaQK/IW u8RxhB/dw+2yXxTsw3OE6Su6oSQLST2atNfEk5uC5kd8/g9EMKVVHmL78dtgnk9E1I55 UXB2TfgQlHYAFxCNZZMEt5IFaGzeyXSqQY8OYLVfN5qT+oVmNXqVChvUkmVoFQ/fmS/Q aztA+6+jzKWSJZDt95kqDI23H1x3zx/uUtiC5bMo/jFJ0DoZZrc9E2v4WrVrq8HNLFEu MIH2P5t3GQQax3AA8kraRzl8KjME0t/lxVCWGQPgcF/QbcyYIPIGyAIFzMRgGRMe2HBw VV4Q== 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:dkim-signature; bh=x7XzuZHTX79KOo0NhHz+n2DRp/2Ctmdn2rPrkfVwAcU=; b=MYYl7dipBRwXhz7v8WNJHBtT4aN4i5g9gPwWpsZN/5tECjWFlnnQ0SG+DIcpaBPIGE W4pfXFB6Zuqnw52Nl/Q9EbC8RPmUr/FaVYsdkDkqvETxnjxprh2nyOcaZiKAZ5lyqwIA eGFz0t1ubxgp56TapP5tNz0mnzHw/3ImtA/GvxNlxiHhGvcvt6li4RKwnVoJ7khR00Q2 r/x4T8i5bPo1gtv0YCJV0+TrYnlD917miquVWfbrBnhOUFQ/93C3IO+t1GyKP4JqkwsI THxPm9iLwFf3h5dhmQ5ugsXcpuinT3XdJyEdSAAoy9zltHsBFJos+gxwu5lO1Toiepje 2EAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=cq6T20jd; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com. [66.111.4.26]) by mx.google.com with ESMTPS id n21si5967100qvc.65.2019.03.13.22.32.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 22:32:34 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) client-ip=66.111.4.26; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=cq6T20jd; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.26 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 66CA3213BD; Thu, 14 Mar 2019 01:32:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 14 Mar 2019 01:32:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=x7XzuZHTX79KOo0NhHz+n2DRp/2Ctmdn2rPrkfVwAcU=; b=cq6T20jd f0zndyqf3aPS2jJfgynxjjCEtdmIuaFvb3+M+X4uBLKSicfN0ZbZM0HYmeVqdLi9 1N1WGY/WOfXTzeqzC+x25ACgo7Vrgw+4EXnJ7nzXzGznQ8/HlcT469VKBCSlNN/g qv2InpYONKFrKbELh35Z280dplyM9YU99RDBRq/l8j2nNWlB6RPSCilCIOIfE5iM wQc3AkR+UbSfjDma9HJuDedIOCx7qNQgK8qeHdUleeB52qFNd53OgYjALmpo3NUa 0pQdW4p6KH9W02Ysj2EnZM65AbbqpllxuetXCigkwpBFygisNWeormprjdsCBq3S gWEETAtrSdpXdA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrhedugdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepfdfvohgsihhn ucevrdcujfgrrhguihhnghdfuceothhosghinheskhgvrhhnvghlrdhorhhgqeenucfkph epuddvgedrudeiledrvdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehtohgs ihhnsehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpeei X-ME-Proxy: Received: from eros.localdomain (124-169-23-184.dyn.iinet.net.au [124.169.23.184]) by mail.messagingengine.com (Postfix) with ESMTPA id BCF57E408B; Thu, 14 Mar 2019 01:32:30 -0400 (EDT) From: "Tobin C. Harding" To: Andrew Morton Cc: "Tobin C. Harding" , Roman Gushchin , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 7/7] mm: Remove stale comment from page struct Date: Thu, 14 Mar 2019 16:31:35 +1100 Message-Id: <20190314053135.1541-8-tobin@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190314053135.1541-1-tobin@kernel.org> References: <20190314053135.1541-1-tobin@kernel.org> 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 We now use the slab_list list_head instead of the lru list_head. This comment has become stale. Remove stale comment from page struct slab_list list_head. Reviewed-by: Roman Gushchin Acked-by: Christoph Lameter Signed-off-by: Tobin C. Harding --- include/linux/mm_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 7eade9132f02..63a34e3d7c29 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -103,7 +103,7 @@ struct page { }; struct { /* slab, slob and slub */ union { - struct list_head slab_list; /* uses lru */ + struct list_head slab_list; struct { /* Partial pages */ struct page *next; #ifdef CONFIG_64BIT