Received: by 10.223.185.116 with SMTP id b49csp1045384wrg; Wed, 21 Feb 2018 11:07:28 -0800 (PST) X-Google-Smtp-Source: AH8x227WWgQPfvW+EePJbjkHI1sz5wK6KeFbSdleXKsFpR3YHwJVhmthaHcd2JR56E6hxSzZzeFC X-Received: by 10.99.160.80 with SMTP id u16mr3449801pgn.389.1519240048710; Wed, 21 Feb 2018 11:07:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519240048; cv=none; d=google.com; s=arc-20160816; b=HlBncFw6IJTJkhvOq5cNTD+313Mvkl6/CYqMc9JywvjcUgsElrtZa0s5lwfRsL1ybl Pej7yvyYIY6P17dRo75MvUb3f5MgYEF4j1S/I5JYbUJ2POeBOMO8vRPHpn9sce/nGt1s lX5MmoYH2fOHl6M41UBm1+TYrHoCXcvgqdgnzJ3yUHip/Wq+O/2UMyHMOjvfvSL8YnWj tmwsn6aj+MTRNT3z1P674s5q1trWUAC7zygHa3vw8kVrEFePz21H8rS/KMCYcheqP9pD xFm3jlXS67FaTphY9e0FhAzehUFt7vBl6KFsuwCPDHafMqThNxkyKjawuViKrEcaa/Px NvCw== 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:arc-authentication-results; bh=sxbn3DDgQT1wx3AOvmdzBsSP+Px2AvIzoDKe23cw6ZQ=; b=KX58exdwFNS1xCM5zETj96JmOivGqcQQ+zKWNYBRVNE6Qirp40WeUNoIsnocFG7O0h yZHpjPcBiKHJNPyqMvlOkyguAc0Hs+dJz69a918sBqWwYaRJW5oRbkqDBaT8plhevN/z H9D1qY2QTe1H/N7NYhEdmnTJ6Ia8I12fD1udde3v9aFpcb7RyM/MkwTMSh84QZsHC3r8 SmLuXZbDTcx8QFYa/ojrzkVKGwrdXKIgaTD9VjzCq8EsQjD6KhwkQfudppqMpUoDNF8G Jy38P3lkg/lRxcIztQZMhtuC5HVIZwBcu4YFO3hkqcxyra7GDKVacDMXZ3QPiXTJZVzr 6/Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=A2yxhiKP; 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 i70si262638pgc.264.2018.02.21.11.07.14; Wed, 21 Feb 2018 11:07:28 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=A2yxhiKP; 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 S938861AbeBURBi (ORCPT + 99 others); Wed, 21 Feb 2018 12:01:38 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:54574 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932317AbeBURBf (ORCPT ); Wed, 21 Feb 2018 12:01:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=sxbn3DDgQT1wx3AOvmdzBsSP+Px2AvIzoDKe23cw6ZQ=; b=A2yxhiKP5zdSiZj3+oKOA8yPl dQFZq2cv4WpXilr0/msIodpKmGYqSU7183RHBdly2OUkwLIppG2xJQJvRwah93QzZgdxPDOqFGl60 SjOjzNH1j86A2PUSn+KUDk7I75nf9AEOcnfbMRrPYeGSD9qMWJOzf5Z82Ft8EsRkYDNzvX+JMRBmK lvHzIYg7k0MfRdCE3jtM+l/hvOMDxA3baXpGLUc9RR9JuvG5UTP8e/EwVd3miARN04xUJ4isgMU6l WyDIIW+iZZojph/RYE2rZBBfQqbcsbBcS6IJpZpBNUmeJyapNhQfqBRoDxvBxz9MxeVDR/GpYos8K opyXLAcTg==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1eoXlq-0007yk-4X; Wed, 21 Feb 2018 17:01:30 +0000 Date: Wed, 21 Feb 2018 09:01:29 -0800 From: Matthew Wilcox To: Dave Hansen Cc: 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: <20180221170129.GB27687@bombadil.infradead.org> References: <151670492223.658225.4605377710524021456.stgit@buzz> <151670493255.658225.2881484505285363395.stgit@buzz> <20180221154214.GA4167@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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. > 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.