Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1615410ybe; Wed, 11 Sep 2019 18:34:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzC5UTg2ZK3+t+d2T3vUre4KnznDM1p0mMA2pKUcKdIKVjrO31S7zW2hmGTvQUebZlhtHo1 X-Received: by 2002:a05:6402:7cd:: with SMTP id u13mr27247767edy.14.1568252044066; Wed, 11 Sep 2019 18:34:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568252044; cv=none; d=google.com; s=arc-20160816; b=SjvFV5ef5CyVw0LSKB3797ohvBiMZKvE31A+LlybdSdQjvbDG6mzcP+SZJFNWAthSX F3ImnLUQ4FnXcxA+riQgbIHBkneegp1iOhpCwloGlVJK9/47zNRNfC6wku4AJC5dGmkr eSqibPNcsuVc6HXTWEUE+rrK0HQer1cBna9uOPbQ7zk6fhnlvgn1DyUvkeMPb5Et9oE+ RgLUYjtrye3fwkO0i8HJH4oUfmYctS2nQ4zfRC2VJ4XkS390NaUbuE8dxdqxtUvl3KqI LzXWrd387tBVgYwTeVAdQOz+BLp8LTLcMgksYam5+ta89L/yVLztpeLzxgMR//4m/ZaV dN/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VAjn6U6N/arzAqTNNO05V4de66eq/g4N7k2+dh2Hohs=; b=lMcLM0RZi0p4NyTZQxH6P8aI2dZP/hIB19/72rl9okFYJYlXJrqkVGEU7CosLtP1cG MnLmkRHl3AS5IYDuyRhP6JpnLD+25N8C6Ml4IYiCaOYV9une6p23EMIU5a8Zu5Yzaopa jg010XBjbKnpR5Iy0OP53ixubHpUPsqA2VJL9WDDd/efK0DeOMoz3l4MLUjs9pVFNLkw ZRlC7wyIbqgctMIbHexXOq5KBeIWOPgYRXajNW8sOPE+dE5SgXtUq3olXE3smalZelCh GyOYBPlZIEmbUO44GI4zuVcHQCBhQ0EtqDq/iV9NubQNeVBlAXu2yQfy/oLto3kwpAWt +FIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=pPNprPly; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z42si15016904edz.23.2019.09.11.18.33.41; Wed, 11 Sep 2019 18:34:04 -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=@google.com header.s=20161025 header.b=pPNprPly; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729066AbfILBbH (ORCPT + 99 others); Wed, 11 Sep 2019 21:31:07 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:41753 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbfILBbG (ORCPT ); Wed, 11 Sep 2019 21:31:06 -0400 Received: by mail-io1-f66.google.com with SMTP id r26so50510675ioh.8 for ; Wed, 11 Sep 2019 18:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VAjn6U6N/arzAqTNNO05V4de66eq/g4N7k2+dh2Hohs=; b=pPNprPlyDZe9kCLCoAsHCrJIOoTusOUs87tHwEqMZVeeRErd6vEZCRNMVFhQfazg95 DI/4xQ6A2/OcjcLW+MxKWYjFM9fyUBo0Xo+dgO/rdO0HI5iZShwsW+Q/h/CVUCg+R+Ew BZQO1wrCYZWmY1/DF5aysIhXAHoktZNTUFEnOz8scqbHHyOYSRKLFQf7fIS7/kagzwJc 0MieTFBo4fmIOF8SLnGAmMfqW2mzSWN6UZDO/KYnfpzEXp1x90PW/OPgT798oZLzni+q gGkSRi3e4SYCbYU70EBzWSiGrlBNRFwGaX0pK7bOF7785Mq7eW3wz1N7e0LVlPO9Q9nq 1hoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=VAjn6U6N/arzAqTNNO05V4de66eq/g4N7k2+dh2Hohs=; b=OdzIPk4g0qT57xYG1L5MYB9AnoumjR7l/cFeeokYl98DwTika6HUzi4kOTxA+RGQ2j jVtQHJZLKjaQri/OSOwsN0eIWRLGdyV68ZDKsXA1QOX1FN/eaj/LASOMtAhMkrsLC7eD 0duOGsSrgvh4zDN3fmtujwr3PSsWsHemrwCR5zTPbE9xj4wtx320AhMCnvCzedKV6BaJ GQ+fJ8Cwmfefy4KXyqIGk/6rh7EYNe1RIht8bH6pulpJivkj+FiWArdaMQiE2dUzEjzk i7bKt4A1sLsMhTHn3NIsYhxlDwhUyFQINyfqSyZ6HYLWOeHauNUjez/DRRbWMEdpCYSc 33LA== X-Gm-Message-State: APjAAAVrpNzGxK3Rjh9iHh0nnj+b5GaOjzVNyDfg4bk+MJMVVg8klIzC eCYN4POHts8YQoClZ9G2TUZ/sg== X-Received: by 2002:a6b:3705:: with SMTP id e5mr1172039ioa.213.1568251865760; Wed, 11 Sep 2019 18:31:05 -0700 (PDT) Received: from google.com ([2620:15c:183:0:9f3b:444a:4649:ca05]) by smtp.gmail.com with ESMTPSA id q74sm36424390iod.72.2019.09.11.18.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2019 18:31:04 -0700 (PDT) Date: Wed, 11 Sep 2019 19:31:00 -0600 From: Yu Zhao To: "Kirill A. Shutemov" Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Tetsuo Handa , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] mm: avoid slub allocation while holding list_lock Message-ID: <20190912013100.GA114178@google.com> References: <20190911071331.770ecddff6a085330bf2b5f2@linux-foundation.org> <20190912002929.78873-1-yuzhao@google.com> <20190912002929.78873-2-yuzhao@google.com> <20190912004401.jdemtajrspetk3fh@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190912004401.jdemtajrspetk3fh@box> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 12, 2019 at 03:44:01AM +0300, Kirill A. Shutemov wrote: > On Wed, Sep 11, 2019 at 06:29:28PM -0600, Yu Zhao wrote: > > If we are already under list_lock, don't call kmalloc(). Otherwise we > > will run into deadlock because kmalloc() also tries to grab the same > > lock. > > > > Instead, statically allocate bitmap in struct kmem_cache_node. Given > > currently page->objects has 15 bits, we bloat the per-node struct by > > 4K. So we waste some memory but only do so when slub debug is on. > > Why not have single page total protected by a lock? > > Listing object from two pages at the same time doesn't make sense anyway. > Cuncurent validating is not something sane to do. Okay, cutting down to static global bitmap.