Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5392861ybi; Tue, 30 Jul 2019 20:04:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9eqdR6Pkvkc+FPzwLlJgKYgtgq9rpi5kBeE9OTC/SQGjQyTz5JsyIAeAaQW9+10f3/MBO X-Received: by 2002:a17:90a:ac13:: with SMTP id o19mr535112pjq.143.1564542286502; Tue, 30 Jul 2019 20:04:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564542286; cv=none; d=google.com; s=arc-20160816; b=p8UfAL7F7ZlbK6sk4wgpNx1g/9v2VQynkrjUqjFWRsVNkFTVYl/U2q/hgCgbd2/DcD Z7k5ZncGvlVBcF77xkEWA9+WUAgBs1Ayh9xZAKsDUxdVYjHoiXRJdikeMd0wJ2pEOfgw /abNfBcHQF7/zDJQaUk0P0EFkMxGOBjDccXtZw6GRQoQ1RsSDB49ihppsjNCUVI8MEQc k2i9DXZcxy0hMItZxAtPmP6fVsm9q3N/ko8IHJKfsdobNrKh3gr1g951K3OGWV7fHI2d HxaWsINaOVPccE6AN/X9OjURumAOOUO8yjWLgM59HAMFOk21CfcDabHOEcsSPeb78zmh JseQ== 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=P02YqgmHTBcIJHjlAhI3pmvYr3xQglXD30+9G24hZL0=; b=I579bUkWMAU0kzyekSq6nWIU6k42BbsmK8xGZgFqJnDozgFZ4udmfuGFtJ8wwmVN+F nKGdSo3dRnRZzx/DJCSWele4BGq5GDwsk1UbiMHk0aLeS6hTriKiwcB54zhLE3oECBiL kxVoXKq32kK2GwssleL5XagxgJkhlPVCk3vv8R0UfTFhOpBJbvK7xNVuIpkP2+AahvOA +qnZN1Jy6yuM5W1U+bMCyRQEBailJjIxcKYgF08bjkqBRLJ9HQUnq8Ws+f922GIoLHcH yPuEVFGUCaVfE36K1Yr/wTrX38rVzLM+CDjdVURlJON3wefik2pepdzxKp3rJJrhBSxk VXvQ== 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 64si29810879plk.87.2019.07.30.20.03.51; Tue, 30 Jul 2019 20:04:46 -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 S2387872AbfG3Vz7 (ORCPT + 99 others); Tue, 30 Jul 2019 17:55:59 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:32903 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387630AbfG3Vz7 (ORCPT ); Tue, 30 Jul 2019 17:55:59 -0400 Received: by mail-pf1-f196.google.com with SMTP id g2so30536168pfq.0 for ; Tue, 30 Jul 2019 14:55:59 -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=P02YqgmHTBcIJHjlAhI3pmvYr3xQglXD30+9G24hZL0=; b=JfqeC2g2V+5cIel4C2FBoEbpxuKdP1WCR6nuuJpKeOE5lUNbAcnSKyhgVsBPgPvYxj BGuMdnsVfIMqza6URp/OtMX07ffwcHo7pjG47MrUZuPdVku7xGc/lwpkgN8h2bE+POCX yExOFC9+ljlKCqhRyUtGSexJhAwo0bvtoBGierEFHkqPh2ji3HYElQaeoT7Fv+sDIl31 Oq1WZvT9IDkEZESkkOh0MaXfIBO+IBjHX2kTSOYIjaFcBlIznK73joPITvFSEPf1gTUU FYji5mScVoZlCfWeeO4U82TWvEMtmh4YLgS3+Ype31zKA8EdfvUXzTiLyVvvVlgwpnjU 1wow== X-Gm-Message-State: APjAAAUdkvKzOF6EhTIAhLKPzCTw2H3FemVNzP09tRKegFWmj/j5O2+3 zQwYAZg7WkoiU/ZIza1Q/94= X-Received: by 2002:a17:90a:ab01:: with SMTP id m1mr31609955pjq.69.1564523758593; Tue, 30 Jul 2019 14:55:58 -0700 (PDT) Received: from dennisz-mbp.dhcp.thefacebook.com ([2620:10d:c091:500::2:6988]) by smtp.gmail.com with ESMTPSA id m101sm53084226pjb.7.2019.07.30.14.55.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jul 2019 14:55:57 -0700 (PDT) Date: Tue, 30 Jul 2019 17:55:35 -0400 From: Dennis Zhou To: sathyanarayanan kuppuswamy Cc: Dave Hansen , Uladzislau Rezki , 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: <20190730215535.GA67664@dennisz-mbp.dhcp.thefacebook.com> References: <20190729232139.91131-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20190730204643.tsxgc3n4adb63rlc@pc636> <9fdd44c2-a10e-23f0-a71c-bf8f3e6fc384@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9fdd44c2-a10e-23f0-a71c-bf8f3e6fc384@linux.intel.com> 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 02:13:25PM -0700, sathyanarayanan kuppuswamy wrote: > > On 7/30/19 1:54 PM, 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. > > I agree with Dave. I don't think this issue is related to NUMA. The problem > here is about the logic we use to find appropriate vm_area that satisfies > the offset and size requirements of pcpu memory allocator. > > In my test case, I can reproduce this issue if we make request with offset > (ffff000000) and size (600000). > > > > -- > Sathyanarayanan Kuppuswamy > Linux kernel developer > I misspoke earlier. I don't think it's numa related either, but I think you could trigger this much more easily this way as it could skip more viable vma space because it'd have to find more holes. But it seems that pvm_determine_end_from_reverse() will return the free vma below the address if it is aligned so: base + end > va->va_end will always be true and then push down the searching va instead of using that va first. Thanks, Dennis