Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3536634imc; Wed, 13 Mar 2019 22:32:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPFho5tCFvGBt2OxU9fePnzjOqrOOoecrKH2ecF1z8f1YGCBQPKsLCcyRt8u6sgBVDcHFE X-Received: by 2002:a17:902:7784:: with SMTP id o4mr21229946pll.152.1552541577040; Wed, 13 Mar 2019 22:32:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552541577; cv=none; d=google.com; s=arc-20160816; b=hw+6NXKjq1Oiv5ZhnbRulM+5GGgV/vlFcAv9OccnqzSPzf/LUW7jAoHsxFxKqQiE7g yoUk7oDrDJnSsra+adVBVqouQkCsz3J+1hDo/5FH7aZbWL+WfM4vtSOnX/rjGsFulKbP DibK4sVkn7VYXwN52T6Z3bw17frXAAJL2kVXKmP/LTI9slfB2b4OHNydjTtSch20FyLB NO1fWDEAJOXwE8ZksnWKEtem3pZzx2oIvzyWjJNrwoKWdNqfe1KsGKAZGSeXahDpu54s 4rYGyHWmxpZI/Y0zQB5BkUpCrz7ec8DoXDe2xkdU4aSbn2rArR1M8rR/GfGEIf8GqNsw 8ErQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=0As+3Iv3Sxmfep8uKsH5/xjkJPw9kSFzNL2pVLlfV7o=; b=if4Kv4OSPjIhQfBXlvusAc+MJ8i1H0JcoFLTwNaZ5oDij3JnemYU7iiCRYYphBEcJY E3Bvtmc4pgLTC3E6Ge0NNbqgegYlXtJxnp+/1i6Gr5wg0Xk/JKtyhc6DCUPVA6wGJ9Qw 5FTFXdjmGJVmxMhWMWfCxZSqUGsRfd1ocOCQat9RHlcXfviOJir9oIxcGJycoEXJtaRS v7y+2vqCOyuAjTXQHugEI+QjNWsNxwEUc5ZWYE+Q3pJ+1aW7MEpNGSo+iHh/CLPJRkSi ol1807G65sA9rJX9BspIJ6gkJNh45TDi3ho8fn7WzoQYvFK2FqETOGs8qW7dNluc3i36 hvDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=nXFyTnSv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b11si13263679pla.195.2019.03.13.22.32.41; Wed, 13 Mar 2019 22:32:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=nXFyTnSv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726717AbfCNFcI (ORCPT + 99 others); Thu, 14 Mar 2019 01:32:08 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:41313 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbfCNFcI (ORCPT ); Thu, 14 Mar 2019 01:32:08 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id A6DAC213BD; Thu, 14 Mar 2019 01:32:07 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 14 Mar 2019 01:32:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=0As+3Iv3Sxmfep8uK sH5/xjkJPw9kSFzNL2pVLlfV7o=; b=nXFyTnSvQ0TXZ5esZxcjU2Z6vcxxfwqmZ e4QC8rQzhDCWT/uGYUgxLo6y3GTtFjjfIX6REQiGEwetHoG7K6qpJy1yQZhimGet mZO2iZOBRIS+PPIJRbT3m6YK8hFi+CJpaeUcylBhAwk/6rnso8WU1BItuOQ1e6O+ 9u+TU1WG8GYWePLEVSkHO0yaPn+ZThhTTymCL4XaNdJPXo2c+aJbV4oga2ob1U2q SfDI7JCRjkWv5mITQHY1+6r4543vxEfIpu9ezTDGcqISFFP3sAHfTjkNsSNqFwZG Yx3+KWjweqOMK4G+cfiRZnG+1+xrV0/SG013bqPbQuMtUVk0sRYrQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrhedugdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepfdfvohgsihhnucev rdcujfgrrhguihhnghdfuceothhosghinheskhgvrhhnvghlrdhorhhgqeenucffohhmrg hinhepghhithhhuhgsrdgtohhmnecukfhppeduvdegrdduieelrddvfedrudekgeenucfr rghrrghmpehmrghilhhfrhhomhepthhosghinheskhgvrhhnvghlrdhorhhgnecuvehluh hsthgvrhfuihiivgeptd 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 811BCE415C; Thu, 14 Mar 2019 01:32:00 -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 0/7] mm: Use slab_list list_head instead of lru Date: Thu, 14 Mar 2019 16:31:28 +1100 Message-Id: <20190314053135.1541-1-tobin@kernel.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently the slab allocators (ab)use the struct page 'lru' list_head. We have a list head for slab allocators to use, 'slab_list'. During v2 it was noted by Christoph that the SLOB allocator was reaching into a list_head, this version adds 2 patches to the front of the set to fix that. Clean up all three allocators by using the 'slab_list' list_head instead of overloading the 'lru' list_head. Patch 1 - Adds a function to rotate a list to a specified entry. Patch 2 - Removes the code that reaches into list_head and instead uses the list_head API including the newly defined function. Patches 3-7 are unchanged from v3 Patch 3 (v2: patch 4) - Changes the SLOB allocator to use slab_list instead of lru. Patch 4 (v2: patch 1) - Makes no code changes, adds comments to #endif statements. Patch 5 (v2: patch 2) - Use slab_list instead of lru for SLUB allocator. Patch 6 (v2: patch 3) - Use slab_list instead of lru for SLAB allocator. Patch 7 (v2: patch 5) - Removes the now stale comment in the page struct definition. During v2 development patches were checked to see if the object file before and after was identical. Clearly this will no longer be possible for mm/slob.o, however this work is still of use to validate the change from lru -> slab_list. Patch 1 was tested with a module (creates and populates a list then calls list_rotate_to_front() and verifies new order): https://github.com/tcharding/ktest/tree/master/list_head Patch 2 was tested with another module that does some basic slab allocation and freeing to a newly created slab cache: https://github.com/tcharding/ktest/tree/master/slab Tested on a kernel with this in the config: CONFIG_SLOB=y CONFIG_SLAB_MERGE_DEFAULT=y Changes since v2: - Add list_rotate_to_front(). - Fix slob to use list_head API. - Re-order patches to put the list.h changes up front. - Add acks from Christoph. Changes since v1: - Verify object files are the same before and after the patch set is applied (suggested by Matthew). - Add extra explanation to the commit logs explaining why these changes are safe to make (suggested by Roman). - Remove stale comment (thanks Willy). thanks, Tobin. Tobin C. Harding (7): list: Add function list_rotate_to_front() slob: Respect list_head abstraction layer slob: Use slab_list instead of lru slub: Add comments to endif pre-processor macros slub: Use slab_list instead of lru slab: Use slab_list instead of lru mm: Remove stale comment from page struct include/linux/list.h | 18 ++++++++++++ include/linux/mm_types.h | 2 +- mm/slab.c | 49 ++++++++++++++++---------------- mm/slob.c | 32 +++++++++++++-------- mm/slub.c | 60 ++++++++++++++++++++-------------------- 5 files changed, 94 insertions(+), 67 deletions(-) -- 2.21.0