Received: by 2002:a17:90a:8582:0:0:0:0 with SMTP id m2csp2417308pjn; Tue, 2 Apr 2019 16:09:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxV+vDWIL3tg4iF4vjoWflCkffwBOPXa+T+GU7ZE6pRomuMKsYpkQr7nhfznvEEZadwnZPI X-Received: by 2002:a17:902:1123:: with SMTP id d32mr9634420pla.16.1554246558527; Tue, 02 Apr 2019 16:09:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554246558; cv=none; d=google.com; s=arc-20160816; b=HPkn9ZE94A5GyYe7ewJr0caVijRWHwSSVufbruprXA87ckRGgnBUdiZeGOaU5BU3Vd 8QV0Cs6LHm8LBxsJuatrte6PxPFstetIDDJaxK7DqOX3eQgJBns8zGNWNipIQSZqvW11 ONmeLMgKcS++SSHy9Wy++3gE+RMQH98coRqyXQZdyNMzfnGex4qJciFEnI+xgKo8161Y WzzR2uay+DsN0btJpYMvjTLfIkaRrmIhwMCWKiBjHi/MPm/Nhc2t9fT7FZAJ1hzSzS/Z 1JONNaqnvqxIZZNLrBjofXswfZL3sgB0TMybZwnSXM1fXXDr5lvBlJFZlFgVqPnVT05g w9dw== 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=l8c5endvJscPewd22ZTuMis3Zjlpf6zi6ZDP1+P2ofI=; b=ozMwtvW6CO6LZ7uqm5Hz7OuNd6OSc3OF8zBTdYOexNBCrVkJ/ZDkH27g9qdcFb0xV2 aXzQkCpyOejTgxF0t4YOaKdP/9OFEQhO59s7Nq88Dieo2V/FyyX6LXKgHoonMETLF62o 9rt24tWcW05BpVK0gUROW8IWNzke8gmw5vdECb8M6FpoUGAuT1giRBrn3AkfLTrc/cRI FThV/NmiPxySXhWDEnsbowEZ5UF2FKkf6IZq5G2Qe9uuJmerJiNldc899m1L6Hznuuxr K6E+rkVIM5g8ozVa6ogVfOdA9Xuj2DBO+erIK1NArZwq1Gxds9bdhVYvad9HgytOSclp 8P6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=nM0+XCot; 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 m16si9345084pls.150.2019.04.02.16.09.03; Tue, 02 Apr 2019 16:09:18 -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=nM0+XCot; 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 S1726510AbfDBXG2 (ORCPT + 99 others); Tue, 2 Apr 2019 19:06:28 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:44013 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726083AbfDBXG2 (ORCPT ); Tue, 2 Apr 2019 19:06:28 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 5D9D721F01; Tue, 2 Apr 2019 19:06:27 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 02 Apr 2019 19:06:27 -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=l8c5endvJscPewd22 ZTuMis3Zjlpf6zi6ZDP1+P2ofI=; b=nM0+XCotwYgyyp+aIrzkVuUlO3vBiZiMl NhDd+NNkIrwuxQatdvngcz0uoq4WFUzaYghV7U04+LyAKqRSrfj3SYCu/619irQ1 otkqhxHfvErJHKMpH7bersJh6JXmdWljB1PUnhFrJzoC477+DrS9hGVPnHKq+5zK tIxUPns+amcbKkfeyKAmth9d5II/lsXmvKCn/8jCsEjydZUzWp5W5DMClKRIFDec NKNVxCmX+4Qu92a/iQ68wty/d7tkXBm4T/Krpqoia3AUGbWZFlahm/dC7rCnNejJ ToVjT24JgmdKtvlVHYjFxDFVx0qmZFRfX1LlzuEKP+dl28tNy7Hkg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrtddugdduieculddtuddrgedutddrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvffufffkofgggfestdekredtredttdenucfh rhhomhepfdfvohgsihhnucevrdcujfgrrhguihhnghdfuceothhosghinheskhgvrhhnvg hlrdhorhhgqeenucfkphepuddvgedrudeiledrvdejrddvtdeknecurfgrrhgrmhepmhgr ihhlfhhrohhmpehtohgsihhnsehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiii gvpedt X-ME-Proxy: Received: from eros.localdomain (124-169-27-208.dyn.iinet.net.au [124.169.27.208]) by mail.messagingengine.com (Postfix) with ESMTPA id 9A2171030F; Tue, 2 Apr 2019 19:06:21 -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 v5 0/7] mm: Use slab_list list_head instead of lru Date: Wed, 3 Apr 2019 10:05:38 +1100 Message-Id: <20190402230545.2929-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 Hi Andrew, Here is the updated series that caused the bug found by 0day test robot. To ease the load on your memory, this series is aimed at replacing the following: Original buggy series: mm-remove-stale-comment-from-page-struct.patch slub-use-slab_list-instead-of-lru.patch slab-use-slab_list-instead-of-lru.patch slob-use-slab_list-instead-of-lru.patch slub-add-comments-to-endif-pre-processor-macros.patch slob-respect-list_head-abstraction-layer.patch list-add-function-list_rotate_to_front.patch And the bug fix patch: slob-only-use-list-functions-when-safe-to-do-so.patch Applies cleanly on top of Linus' tree (tag: v5.1-rc3). This series differs from the bug fix above by adding a separate return parameter to slob_page_alloc() instead of using a double pointer. This is defensive in case later someone adds code that accesses sp (struct page *), also it is easier to read/verify the code since its less 'tricky'. Tested by building and booting a kernel using the SLOB allocator and with CONFIG_DEBUG_LIST. From v4 ... 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. Changes since v4: - Add return parameter to slob_page_alloc() to indicate whether the page is removed from the freelist during allocation. - Only do list rotate optimisation if the page was _not_ removed from the freelist (fix bug found by 0day test robot). Changes since v3: - Change all ->lru to ->slab_list in slob (thanks Roman). 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 | 59 +++++++++++++++++++++++++++------------ mm/slub.c | 60 ++++++++++++++++++++-------------------- 5 files changed, 115 insertions(+), 73 deletions(-) -- 2.21.0