Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9474515pxu; Mon, 28 Dec 2020 17:52:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbGts7Sp9G02JHQRDndbfrVlfz/bxnegpDkIS/aT8HyupTr/71J8VHAF4tK+R7psG3T3+l X-Received: by 2002:a17:906:1151:: with SMTP id i17mr44589997eja.250.1609206763037; Mon, 28 Dec 2020 17:52:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609206763; cv=none; d=google.com; s=arc-20160816; b=0b46Zxk/f55DlfoYtykgDmcrjMo8m35Zpni3OGcblpVbN6hUtoeDtyAhMiq0UalAOt sitw6/lwYViADQSAGV4rW13/caxtZHzDBTZGUAKmao+xD/Wa558fA2C4w3KaLtJhZoen b7JlxGO4Mk9+6RhPURJd8QeeowexOoQo8NnKvlN3W77MSrpY850Q9dnWQrTEHzQLbHJD KKzqewmLfJcWLaqw6XEn/1ijP4m+NC1lGi5vDWdn1ZVuHyria0MqalocsdzdWhUJvmqW 5dMAdX/lmeSgNZIu0Ve0gp4DUOJapf5J+kFuL70JH2K5cOTWvt+9xMOBo6eXDdQXsvYE 4GfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=jTblGVy12KttnCpCdJ35MVlE2TQ4BSno7et+Y7H5Mfg=; b=K4tw0cgCPUn8sMBKVSqkJdlAkAomgAtldbJNu7VUbZmahJ6dyJMZdTP4pqno8PX3HC LuXN+vj2gOnhrPrO4bOGeIf6ms9LSA3DV6x2ghKFhF4kTBLssmHGSbepB7EmUxvDeFcG SsM4llOL9yG0rEIIhcS2tndpRVAmwZFquaBEcOGJOoOAREmkfWqr/HAR5L2TMIo7T7g6 y9xSyDDTYMJB8md3fzZG7Vvhdb/IGdZ27+wLbbGH48/jT9a3SQFkRwBoVyOUvOAVKGJR R7yrTTztIYuxLDnD3gBeokTEjrzKZ1zNzyOR9jZQlRonOgAoAqwaLOyr641X6vEu10G1 ci3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j9heRQVh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si17007448eji.541.2020.12.28.17.52.20; Mon, 28 Dec 2020 17:52:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j9heRQVh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730312AbgL2BL1 (ORCPT + 99 others); Mon, 28 Dec 2020 20:11:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730280AbgL2BL1 (ORCPT ); Mon, 28 Dec 2020 20:11:27 -0500 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA279C0613D6 for ; Mon, 28 Dec 2020 17:10:46 -0800 (PST) Received: by mail-qt1-x829.google.com with SMTP id v5so8079802qtv.7 for ; Mon, 28 Dec 2020 17:10:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=jTblGVy12KttnCpCdJ35MVlE2TQ4BSno7et+Y7H5Mfg=; b=j9heRQVh+jzLspOpfU+dZ9v5/6Yj4OgxBhU4m/3bCIK52i36ADCx9E3y8Cb+Za1Xbk VvFFevVP0fTjYWjeOVYlmirhCGyXErQlr5EiB7WkWvngFsLeTQ6iNO7txJquQqC7W4zA pahrsdYaVf2uocS5iyV4Fs7SsHVusLSg5u/rSP8nuW3cvCtsXuhHXlC1vXcDb/K/hIEj YsLDodEMgkmahlL1SL0a3ti/iUtKR4c03lVRnc/7kc9wxIqd0XqK1h8OScYsBFLBSJiu F6oY07OLzpdrlpHOIufpNKb70jQ23lGOtq31TydflOmFr2FHdqDu1nu+BPlQwOXGH0lW m5FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=jTblGVy12KttnCpCdJ35MVlE2TQ4BSno7et+Y7H5Mfg=; b=Dlt3x0zf7QTHxLPmPJU8hHqCn+XjwcCLp4RDiVHqanJ5V9pFiRqsTXFMJns6fzgg/z I11FLEcRZydArup9OCpRl0JFGXNpRqBEdzoDLdTbRe/gbJN3CcX1YrRTOhUswvAfqJ21 xSPLA2mpxT3h8IusVlySdOjMyg73/YM1/EaD+bWQrE7uOGvgqVAYxIn+cF3wFuPQ2QLz s89vFXjx1hlvkpTjdf2Nr92QcNbF19OhnQ7fOfMqUdWqrqEdOJCrQ5Ikg+LPHfXTWkvD eyH6sXVMJ1e+8KHIzJTtDwXpjr05HXPMX5ZhelyUctECw2grWpNUz6wKtHQjvD1jBbCI jSag== X-Gm-Message-State: AOAM5328tHpBIgBIfKLNFBZttze7wqP32UQV7Cdzacm5cGIBMxdGpnaY xHcdAPVhbqOWz+j6BgrWlQdQcM8v5UV0xrYDRFs= X-Received: by 2002:ac8:58d1:: with SMTP id u17mr46735628qta.158.1609204245809; Mon, 28 Dec 2020 17:10:45 -0800 (PST) MIME-Version: 1.0 References: <20201228130853.1871516-1-jannh@google.com> In-Reply-To: <20201228130853.1871516-1-jannh@google.com> From: Joonsoo Kim Date: Tue, 29 Dec 2020 10:10:34 +0900 Message-ID: Subject: Re: [PATCH] mm, slub: Consider rest of partial list if acquire_slab() fails To: Jann Horn Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2020=EB=85=84 12=EC=9B=94 28=EC=9D=BC (=EC=9B=94) =EC=98=A4=ED=9B=84 10:10,= Jann Horn =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > acquire_slab() fails if there is contention on the freelist of the page > (probably because some other CPU is concurrently freeing an object from t= he > page). In that case, it might make sense to look for a different page > (since there might be more remote frees to the page from other CPUs, and = we > don't want contention on struct page). > > However, the current code accidentally stops looking at the partial list > completely in that case. Especially on kernels without CONFIG_NUMA set, > this means that get_partial() fails and new_slab_objects() falls back to > new_slab(), allocating new pages. This could lead to an unnecessary > increase in memory fragmentation. > > Fixes: 7ced37197196 ("slub: Acquire_slab() avoid loop") > Signed-off-by: Jann Horn Acked-by: Joonsoo Kim Thanks.