Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp938227yba; Mon, 1 Apr 2019 21:48:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwO58yEEv8mRgFbaqWASUwDpKLnijJbDNA0xMJ+FzRyVHJd0wDe0LI5DCxdNloH/XIIp459 X-Received: by 2002:a65:63d7:: with SMTP id n23mr3493523pgv.26.1554180518788; Mon, 01 Apr 2019 21:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554180518; cv=none; d=google.com; s=arc-20160816; b=srX82DihVWcH8K5k2dU1JVtnxV8P+DbIjhlRr+6ddZ5m9bia9B16pldb7xvlEgvNua wXIO5SZ2IQMHOhybFCvQaIeuT9L+rDZEF3p6b1FGs5qeb+cEma1p+B0oik4LBzdR5U9q RP4BZbnYfajfQSOh3YR52CQpcWkto8sc7kYt0N4VqFqwcgngl6tk9sp0wTM4Pj3nWprq EYZ3NKjIV9H3x0QSsvYkZpVvAORNCi3cZ5QRSY7WNArkLDsB1G+ABm3bySTlE2KA+7b1 07UxfpPRxGoF7g1uKfTlQxYJ0WDbeKnZLsiO18KF0BvsgG2d3EvIwUfySKLSBCoIvvwZ GFPQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=jVaQRIMwgXdbDZWprpsYiL3hhteVrFSuWgZpVcatz8E=; b=ntQRdmh/ojaosjglSB/Sx4moFhNL/hJGmJAapzrFmKUnHe0H8Jls3SperZrSqG17fg gGqmI1dwO8mBqk8id+XGPsKzX1ynbBzv4dMRQkn4oE7fTgFHNXiPqrLQPBubg6QR7hh8 C9qqV3MvlZTpUUWoxxAibXzVigGLntzSRMonxEpMJBsqLV55O78g/n3k5LccgIYrXNbV SkeQIVWRBpeqZQeeYBO3SoRJgxDcK+QComFNf8xoYgv84xvXuiA6KDaUy5oucg2KAv29 LRcDxOwlUISfi+vIhii3sGc8A1vYC+Fw1xRf+56Np0r5KKtVfEj77052iqiq+cdi7ySw /vpQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k10si10577515pfj.132.2019.04.01.21.48.22; Mon, 01 Apr 2019 21:48:38 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727065AbfDBElb (ORCPT + 99 others); Tue, 2 Apr 2019 00:41:31 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51560 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725863AbfDBElb (ORCPT ); Tue, 2 Apr 2019 00:41:31 -0400 Received: from localhost.localdomain (c-73-223-200-170.hsd1.ca.comcast.net [73.223.200.170]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A4A47CAF; Tue, 2 Apr 2019 04:41:29 +0000 (UTC) Date: Mon, 1 Apr 2019 21:41:28 -0700 From: Andrew Morton To: "Tobin C. Harding" Cc: LKP , Roman Gushchin , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel test robot Subject: Re: [PATCH 1/1] slob: Only use list functions when safe to do so Message-Id: <20190401214128.c671d1126b14745a43937969@linux-foundation.org> In-Reply-To: <20190402032957.26249-2-tobin@kernel.org> References: <20190402032957.26249-1-tobin@kernel.org> <20190402032957.26249-2-tobin@kernel.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2 Apr 2019 14:29:57 +1100 "Tobin C. Harding" wrote: > Currently we call (indirectly) list_del() then we manually try to combat > the fact that the list may be in an undefined state by getting 'prev' > and 'next' pointers in a somewhat contrived manner. It is hard to > verify that this works for all initial states of the list. Clearly the > author (me) got it wrong the first time because the 0day kernel testing > robot managed to crash the kernel thanks to this code. > > All this is done in order to do an optimisation aimed at preventing > fragmentation at the start of a slab. We can just skip this > optimisation any time the list is put into an undefined state since this > only occurs when an allocation completely fills the slab and in this > case the optimisation is unnecessary since we have not fragmented the slab > by this allocation. > > Change the page pointer passed to slob_alloc_page() to be a double > pointer so that we can set it to NULL to indicate that the page was > removed from the list. Skip the optimisation if the page was removed. > > Found thanks to the kernel test robot, email subject: > > 340d3d6178 ("mm/slob.c: respect list_head abstraction layer"): kernel BUG at lib/list_debug.c:31! > It's regrettable that this fixes slob-respect-list_head-abstraction-layer.patch but doesn't apply to that patch - slob-use-slab_list-instead-of-lru.patch gets in the way. So we end up with a patch series which introduces a bug and later fixes it. I guess we can live with that but if the need comes to respin this series, please do simply fix slob-respect-list_head-abstraction-layer.patch so we get a clean series.