Received: by 10.223.185.116 with SMTP id b49csp1039008wrg; Wed, 21 Feb 2018 11:01:28 -0800 (PST) X-Google-Smtp-Source: AH8x224IOr+YEXe200o79K9zJtw5X0FwXaCC5qW8U6bGjRexl2B94CCeqsAIcB4YW4VMOnkwqcUa X-Received: by 10.99.1.130 with SMTP id 124mr3568668pgb.208.1519239688015; Wed, 21 Feb 2018 11:01:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519239687; cv=none; d=google.com; s=arc-20160816; b=UTpuzg+SAFp3rxgdytpjkufkT3Aw50+BX10+NpPX5UxiLGMtxy6V7r6P3YGSRNWYqc rrPHePan/lvcIhoeAkOwVwk+9gYN4APW+f/wEa3lZBLCoRVB8IeHGwtG850DCtbnvlTi jN0PEPI+SgHmlpX6lkef6c6OkfjdPY/ubtOYy92A1GxSqyujfhtm95idje/hd0CuzUGn nqcirLgy05qk3oC4qt+G2SQWcXeEkfAN3PftMltmMEA6GAJLjzkg4cPNHrJZuRcvs0X1 qXp5l/Wf5U/etcwql4wk28AyeKCIWPw74ZAzqXZ9QNxssCUULjAzA71ljFw1O6fd4qcj AFgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:cc:references:to:subject:arc-authentication-results; bh=NoMtkZuN1qozFm1bHqDrq0F70nuTXaGTgh9XpAjF2z4=; b=Sa3ZkCR0LBEKsx9/lXARqcyywN4lo6J1KSg1wEBjUM/IrEUv9kftkHPNFr1/uLXEon eQZxWOMoDwUbobw+Xcf7j0+EV3vM61tMdqLsiG4fYmXq5lV35DWilKcqtkZulG+bUMy/ F41Ty9aRGnfMlmN54nBOfKR8RmDeI/8IhOyESfnqsoIElyxifaXV6TV3VBMGniRpqZHz D7x0kUWnRpLDLxdpg/qOIqbQckhVfQ/WW2UWIaXykmfcSbtkVj8zqRWq4EWjfXwc695Y VTWq2Cdg+kd1UFr8Va6g1KoF1G/kjodlk51HaUxNwW5a454y1dUGKmktpZIN7p2EBDxN 54LQ== 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 i13si2392121pgq.508.2018.02.21.11.01.12; Wed, 21 Feb 2018 11:01:27 -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 S932188AbeBUQRK (ORCPT + 99 others); Wed, 21 Feb 2018 11:17:10 -0500 Received: from mga01.intel.com ([192.55.52.88]:17652 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751952AbeBUQQ0 (ORCPT ); Wed, 21 Feb 2018 11:16:26 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Feb 2018 08:16:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,543,1511856000"; d="scan'208";a="205929989" Received: from pdbach-mobl.amr.corp.intel.com (HELO [10.255.230.5]) ([10.255.230.5]) by fmsmga006.fm.intel.com with ESMTP; 21 Feb 2018 08:16:25 -0800 Subject: Re: Use higher-order pages in vmalloc To: Matthew Wilcox , Konstantin Khlebnikov References: <151670492223.658225.4605377710524021456.stgit@buzz> <151670493255.658225.2881484505285363395.stgit@buzz> <20180221154214.GA4167@bombadil.infradead.org> Cc: linux-kernel@vger.kernel.org, Christoph Hellwig , linux-mm@kvack.org, Andy Lutomirski , Andrew Morton , "Kirill A. Shutemov" From: Dave Hansen Message-ID: Date: Wed, 21 Feb 2018 08:16:22 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180221154214.GA4167@bombadil.infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/21/2018 07:42 AM, Matthew Wilcox wrote: > On Tue, Jan 23, 2018 at 01:55:32PM +0300, Konstantin Khlebnikov wrote: >> Virtually mapped stack have two bonuses: it eats order-0 pages and >> adds guard page at the end. But it slightly slower if system have >> plenty free high-order pages. >> >> This patch adds option to use virtually bapped stack as fallback for >> atomic allocation of traditional high-order page. > 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? 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. 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.