Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5230824ybi; Tue, 30 Jul 2019 16:39:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9zCjsjuf6jzvYExz2a0YlJH1N8iANGi53RV0dCjXA7ROS1nN+GOvZwUXVgEeSQ9EjJ8Xi X-Received: by 2002:a17:90a:8985:: with SMTP id v5mr2478pjn.136.1564529974657; Tue, 30 Jul 2019 16:39:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564529974; cv=none; d=google.com; s=arc-20160816; b=nqvj015efl+D3NkN3Eq5jp1daM66VILAj/NHmjnLVXRFSBmk5TItUdNnzWfFMmcny5 Mxh5QmVjEDf1RHglmIcQ8/mYuv/aCYVeTV8lGC6/G0TU7Fp6xbRmDi92iVTJjgK8rMG6 9m2WiD46RoY/mbYSWXfQZAtnOlp24+61MJdNSm9/WGirKvmnfjN+bBijNp3oJMJqf6s9 nTE1Y11rnFzMEilOwHf+F6zz8kvqd/Or6M0eyeNCoH6hTIdsU6E0kQ43Ld1Fl6i0YRqh pYM34gP3ed61GhYXLcjkl79zD55ZC0vSC7oy/3gjeKE9R1DcX2LTXMa8jnrNdMMBSSLh QZEQ== 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; bh=6d3g5Eb7RssGimuUVLnc9Oe3VuINI0PuovERS1dVP0w=; b=m4evsmEyOJ50rg2e84jXyAhGQ5kCQoYmZV5W6O7x+FHQaO5km9hUAXJivBgCLfwwhW rsJJ21crAyElXdo0bA0Y3g+89MyolyqihCl3tneo9NNFJWrbtdLrtAdO7DyXvBBIhaF7 WUm1JRb6f7YaEZeASATNwGuMG5MuI8VDzRsvz4MinjdfefMd7eO4HiuFozwSmjkmrWUG R84mOMg+ZGbspQbbkOzYidRqmRsfPmh54PlvjeoYZH+iV85zm8MinHaWBRUi2IDhypTE i9FKIaE4g03RO4pvZNyOlikCkr7SyoOgo2Lubj3/70vpt4My14TEO5BsSSeEhn0qYgu0 zHVg== 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; 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 d4si32716703pgm.357.2019.07.30.16.39.20; Tue, 30 Jul 2019 16:39:34 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387574AbfG3VJ4 (ORCPT + 99 others); Tue, 30 Jul 2019 17:09:56 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:33623 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726050AbfG3VJ4 (ORCPT ); Tue, 30 Jul 2019 17:09:56 -0400 Received: by mail-qk1-f196.google.com with SMTP id r6so47649718qkc.0 for ; Tue, 30 Jul 2019 14:09:55 -0700 (PDT) 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=6d3g5Eb7RssGimuUVLnc9Oe3VuINI0PuovERS1dVP0w=; b=gzLohxw1KICcCmeuRUZVXP9epaqSm+vrgI5WCC9J+aToe9PC2rF0glarw3xaa2IbwE 0bc5EB8OXSoI6WRvHu0jzFyX8TL1O1CmWE9vcxRh/Tnb60a+EUQhczGyYFvFfXq7ebjM fnxxc8MftflpLvsidbMbapkmb2G29SCYE5ara/fZle8vEAmzWpfZuBQbsik54w6atLnK MwHJiYB4Fu9oVBi2Eok+PBgFDeNKpL8vQ69pxPAWweWB6UhOJ9OtVRWV+e3a4ylYfaV2 VJ9BfAwl0RnTrOrVCk4jP00W2Kl/G69cKc2+r/o0MdpP9nC32rb9OV6Bsl62e3eq+7+A yjRw== X-Gm-Message-State: APjAAAX3hbLoj56p1BgxbPKTYTcXfUtUIflpLSZhREp16yZtvzNjhWQY /OR+FP83XJ6ZbcYJgtYFg4s= X-Received: by 2002:a37:9b92:: with SMTP id d140mr76382522qke.443.1564520995282; Tue, 30 Jul 2019 14:09:55 -0700 (PDT) Received: from dennisz-mbp.dhcp.thefacebook.com ([2620:10d:c091:500::2:6988]) by smtp.gmail.com with ESMTPSA id k33sm33021721qte.69.2019.07.30.14.09.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jul 2019 14:09:54 -0700 (PDT) Date: Tue, 30 Jul 2019 17:09:52 -0400 From: Dennis Zhou To: Dave Hansen Cc: Uladzislau Rezki , sathyanarayanan.kuppuswamy@linux.intel.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/1] mm/vmalloc.c: Fix percpu free VM area search criteria Message-ID: <20190730210952.GA62702@dennisz-mbp.dhcp.thefacebook.com> References: <20190729232139.91131-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20190730204643.tsxgc3n4adb63rlc@pc636> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Tue, Jul 30, 2019 at 01:54:06PM -0700, Dave Hansen wrote: > On 7/30/19 1:46 PM, Uladzislau Rezki wrote: > >> + /* > >> + * If required width exeeds current VA block, move > >> + * base downwards and then recheck. > >> + */ > >> + if (base + end > va->va_end) { > >> + base = pvm_determine_end_from_reverse(&va, align) - end; > >> + term_area = area; > >> + continue; > >> + } > >> + > >> /* > >> * If this VA does not fit, move base downwards and recheck. > >> */ > >> - if (base + start < va->va_start || base + end > va->va_end) { > >> + if (base + start < va->va_start) { > >> va = node_to_va(rb_prev(&va->rb_node)); > >> base = pvm_determine_end_from_reverse(&va, align) - end; > >> term_area = area; > >> -- > >> 2.21.0 > >> > > I guess it is NUMA related issue, i mean when we have several > > areas/sizes/offsets. Is that correct? > > I don't think NUMA has anything to do with it. The vmalloc() area > itself doesn't have any NUMA properties I can think of. We don't, for > instance, partition it into per-node areas that I know of. > > I did encounter this issue on a system with ~100 logical CPUs, which is > a moderate amount these days. > Percpu memory does have this restriction when we embed the first chunk as we need to preserve the offsets. So that is when we'd require multiple areas in the vma. I didn't see the original patches come through, but this seems like it restores the original functionality. FWIW, this way of finding space isn't really smart, so it's possible we want to revisit this. Acked-by: Dennis Zhou Thanks, Dennis