Received: by 10.192.165.156 with SMTP id m28csp2011988imm; Thu, 12 Apr 2018 07:15:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx49j/JOZ0f3kqCJg43waKayGGHXa94INblAonQDIoDnErATHcMKcgQowg/vwNHdb1gdDs+3o X-Received: by 10.101.92.199 with SMTP id b7mr867460pgt.138.1523542505674; Thu, 12 Apr 2018 07:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523542505; cv=none; d=google.com; s=arc-20160816; b=BmAydV9wMZf8hn/J46+453ABKWLumVCllo9+zPESIDpICITAxJZK3gb7X4eHPZ7G2g ptB21S7PMl5tkPNFj0AeiGTDUAokgujR0GLME06mWf1vp25PvEOTOZFfbZ9uFxq5Bz6o QE0rysKbeHD03ZKvxbro1dODYcsGlNfeoLJRgfQr7ds39WS6rgfcXE4aRoYFS46JTMP0 DI5MFY1FHVqF5/YmqmvE+RjKSW1M5AhUKynay08Yzl8CmGG45i9WuyUnW1wtzXEeMwLc uz+sCn1eK6KWpaaaCdRQkqw0s/IH+PfoZG0WiK3QD90zZhZ911m7G6BpIAccT1H/5ws3 64fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=iPCEQGzgRRczw1inv0Cg5VPtA70LuG/DwRP7/iaXdhM=; b=UzJe6RbofFWRk0knae8J311XDtV/zEbR9wTZg34m7bwfdWpZhpJzOw4epuCI/MW5AK ol023lyahtYx7rcDiJcjFclretAcDZqNHCeu1O6mllcCXipbTayGUCetKOZiC/jpQ0QW fPqb0huEpN4lBn5sKAcS9JNxFUaYnnbUtMxC3EVQKMNhIJsBLOWM9C6fARWqgXXLNVYw +h0J0eftIPHOzezdOPAvIHWRJ+qii3e7EwBWTJYdi3FzImcLNnYduwAbmWjJ6CEkqj5A 8YwgPwoJRhwLcWL7JuaLY4+a9On6Y2yGaqBBxHrASqnvkDbCmkmDSbfj3HJCF1kbrMP6 tAvw== 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 z5si2271696pgp.671.2018.04.12.07.14.28; Thu, 12 Apr 2018 07:15:05 -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 S1752883AbeDLOK1 (ORCPT + 99 others); Thu, 12 Apr 2018 10:10:27 -0400 Received: from resqmta-ch2-10v.sys.comcast.net ([69.252.207.42]:58530 "EHLO resqmta-ch2-10v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752426AbeDLOKZ (ORCPT ); Thu, 12 Apr 2018 10:10:25 -0400 Received: from resomta-ch2-13v.sys.comcast.net ([69.252.207.109]) by resqmta-ch2-10v.sys.comcast.net with ESMTP id 6cv7fOVlOKdwr6cvhfpgoG; Thu, 12 Apr 2018 14:10:25 +0000 Received: from gentwo.org ([98.222.162.64]) by resomta-ch2-13v.sys.comcast.net with SMTP id 6cvffrHYz5HhW6cvgfQQhc; Thu, 12 Apr 2018 14:10:24 +0000 Received: by gentwo.org (Postfix, from userid 1001) id 9DE62116168D; Thu, 12 Apr 2018 09:10:23 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 9B4DB1161685; Thu, 12 Apr 2018 09:10:23 -0500 (CDT) Date: Thu, 12 Apr 2018 09:10:23 -0500 (CDT) From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Matthew Wilcox cc: linux-mm@kvack.org, Matthew Wilcox , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-kernel@vger.kernel.org, Jan Kara , Jeff Layton , Mel Gorman Subject: Re: [PATCH v2 2/2] slab: __GFP_ZERO is incompatible with a constructor In-Reply-To: <20180411235652.GA28279@bombadil.infradead.org> Message-ID: References: <20180411060320.14458-1-willy@infradead.org> <20180411060320.14458-3-willy@infradead.org> <20180411192448.GD22494@bombadil.infradead.org> <20180411235652.GA28279@bombadil.infradead.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfHdKeTqCycvX9eUqSw38lJ0XQ0BPFvzD0VX3fYopyYiBBokqkiEpSNhoEeQN/5u1iE2rMVM4U9nk1Oj/Hmu4pCSFieX0Yq/syl7uKpzL1glnwGTqAEBs bxgwGl87ze+oCRuy7G66zJljH2kTKUuZuU8koY66bSbgDx2sgC+lSm3PcV0zyVG5Aw8PaEO+wOGL6eENOdUj2p+Dx6zdM5yExDt/Ew+sbmClK5Sx40leR8eV iTF7mF2p0hlfgttKl1/NKyilCW5U+mzo4bw4SIJQgrMyd0fLWPIEyR+N9D0Z4WTwIqQJLm+JNEcZfiCa34iEORhFbOYWtx9yxTR3SgqIjI2Lns4+czEQHSFy hpSRrYwxO7BFvgzOTLZoDDVbVxqcTHUBvsWi+wAckdMl5MRK5xZylEJjcC37Vmqv6oTi3Fqjp9dQ9qLApTquLLEBjr6xzxTegVSKa7ePOvnmZhSgG6xjyBUh p4Ylb/H95r0Rblt1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 11 Apr 2018, Matthew Wilcox wrote: > > I don't see how that works ... can you explain a little more? > > I see ___slab_alloc() is called from __slab_alloc(). And I see > slab_alloc_node does this: > > object = c->freelist; > page = c->page; > if (unlikely(!object || !node_match(page, node))) { > object = __slab_alloc(s, gfpflags, node, addr, c); > stat(s, ALLOC_SLOWPATH); > > But I don't see how slub_debug leads to c->freelist always being NULL. > It looks like it gets repopulated from page->freelist in ___slab_alloc() > at the load_freelist label. c->freelist is NULL and thus ___slab_alloc (slowpath) is called. ___slab_alloc populates c->freelist and gets the new object pointer. if debugging is on then c->freelist is set to NULL at the end of ___slab_alloc because deactivate_slab() is called. Thus the next invocation of the fastpath will find that c->freelist is NULL and go to the slowpath. ...