Received: by 10.223.185.116 with SMTP id b49csp1587772wrg; Wed, 21 Feb 2018 23:00:41 -0800 (PST) X-Google-Smtp-Source: AH8x2259AlfxZyG9nBRmsOaBPmgiZ8P6izyEZWnlHyjo7Lkp1P2G7GqymbsFF2DgAW0H+xN2k/aF X-Received: by 10.101.98.23 with SMTP id d23mr4877835pgv.275.1519282841259; Wed, 21 Feb 2018 23:00:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519282841; cv=none; d=google.com; s=arc-20160816; b=t3L6TAXgMBGJZ/xhunVcLQ5J+ArpT1JENx7vt+jp8cKJ82QShB7nL90aXIk2yDeyOY q2ldSqggCB1OYqk4BvWeqJaGYZHtBIJhVgLdBq58owL9Fu1Bj8wVNZhPtyGdqRYVwe8h GtedUm11xLVm9ZQH/s0ayyXynWgHRyALwx/nxZ+lUUHL5KHEZ4qGI2vCs5S9+/c8u5Qi cBuqW4WEMwZ/PxBasnb/RjTvZoOBzKMuOh9pscMj838AfZ3OF6uyUfXmISiaC4SoAsWY wLNg5iTr0kP4mmM22qjz1yECWrdYuXwek4/j0ipR1f19wSCjxKXBdCWvZaDNfSaoZ2cj Fo8w== 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:arc-authentication-results; bh=HEw84mXP+MYx1M1W3FHChLetwVjHos81Xzhpe3SUTHw=; b=aJOcxi8xQd7UKyvGoxOnWVf5jqtAatTpT7dTcUKRfM+f1euyLQjvPw/qPOt9mE2Qla BeMkZIH4JjsmljsE7V13cgps0PIeuzRc+vB8g78gaQtvZLaXuW/PsuOjGMipgS3GEU8O NPyHTOrBNq6Y3W0+LX9ocjJ1bn5ofc72ycAdEk+1+WfOam4At6/NcgkTH/ullCytjmjZ A4q/A3gXZVVvo+KB7hvuWNdzGrfpLPQMkOT5MzDal9tDnUax5o9RaFfy359X72Qx3GmD PUUyKWlCPkDqwczJmex6+PlZi/4HcRK6Cl8XCH7scBNCo4xHIWXU6YA+NoSVJGkiveD9 KqXA== 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 k91-v6si8977462pld.361.2018.02.21.23.00.26; Wed, 21 Feb 2018 23:00:41 -0800 (PST) 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 S1752558AbeBVG7r (ORCPT + 99 others); Thu, 22 Feb 2018 01:59:47 -0500 Received: from mx2.suse.de ([195.135.220.15]:49595 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752276AbeBVG7q (ORCPT ); Thu, 22 Feb 2018 01:59:46 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id EDB7BAF4F; Thu, 22 Feb 2018 06:59:44 +0000 (UTC) Date: Thu, 22 Feb 2018 07:59:43 +0100 From: Michal Hocko To: Matthew Wilcox Cc: Dave Hansen , Konstantin Khlebnikov , linux-kernel@vger.kernel.org, Christoph Hellwig , linux-mm@kvack.org, Andy Lutomirski , Andrew Morton , "Kirill A. Shutemov" Subject: Re: Use higher-order pages in vmalloc Message-ID: <20180222065943.GA30681@dhcp22.suse.cz> References: <151670492223.658225.4605377710524021456.stgit@buzz> <151670493255.658225.2881484505285363395.stgit@buzz> <20180221154214.GA4167@bombadil.infradead.org> <20180221170129.GB27687@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180221170129.GB27687@bombadil.infradead.org> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 21-02-18 09:01:29, Matthew Wilcox wrote: > On Wed, Feb 21, 2018 at 08:16:22AM -0800, Dave Hansen wrote: > > On 02/21/2018 07:42 AM, Matthew Wilcox wrote: > > > This prompted me to write a patch I've been meaning to do for a while, > > > allocating large pages if they're available to satisfy vmalloc. I thought > > > it would save on touching multiple struct pages, but it turns out that > > > the checking code we currently have in the free_pages path requires you > > > to have initialised all of the tail pages (maybe we can make that code > > > conditional ...) > > > > What the concept here? If we can use high-order pages for vmalloc() at > > the moment, we *should* use them? > > Right. It helps with fragmentation if we can keep higher-order > allocations together. Hmm, wouldn't it help if we made vmalloc pages migrateable instead? That would help the compaction and get us to a lower fragmentation longterm without playing tricks in the allocation path. > > One of the coolest things about vmalloc() is that it can do large > > allocations without consuming large (high-order) pages, so it has very > > few side-effects compared to doing a bunch of order-0 allocations. This > > patch seems to propose removing that cool thing. Even trying the > > high-order allocation could kick off a bunch of reclaim and compaction > > that was not there previously. > > Yes, that's one of the debatable things. It'd be nice to have a GFP > flag that stopped after calling get_page_from_freelist() and didn't try > to do compaction or reclaim. GFP_NOWAIT, you mean? > > If you could take this an only _opportunistically_ allocate large pages, > > it could be a more universal win. You could try to make sure that no > > compaction or reclaim is done for the large allocation. Or, maybe you > > only try it if there are *only* high-order pages in the allocator that > > would have been broken down into order-0 *anyway*. > > > > I'm not sure it's worth it, though. I don't see a lot of folks > > complaining about vmalloc()'s speed or TLB impact. > > No, I'm not sure it's worth it either, although Konstantin's mail > suggesting improvements in fork speed were possible by avoiding vmalloc > reminded me that I'd been meaning to give this a try. Maybe we should consider kvmalloc for the kernel stack? -- Michal Hocko SUSE Labs