Received: by 10.223.185.116 with SMTP id b49csp7742572wrg; Thu, 1 Mar 2018 10:17:56 -0800 (PST) X-Google-Smtp-Source: AG47ELsQsPcTpU2epzB9gojhe5ogvZudV3kt/Vkjj6vzX45pogI/frZauvpIPlW3XLSXXFAmWou+ X-Received: by 10.101.69.75 with SMTP id x11mr2255160pgr.69.1519928276411; Thu, 01 Mar 2018 10:17:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519928276; cv=none; d=google.com; s=arc-20160816; b=EYw0Ob109wOyPXNXf+p3kCqE3UEwDkM/Z2E3Jq8tVGfKpycFSBBbf+z8iKA7WzKynP Rlm0ZZA5SRduOnhSt2zlf+POKdMNNRM50bnfsoLXy4LaOadaxnb4jqI5xFh03gRTYNw9 6QKwj/eBoa84NsUdnjyTN7Kik9SkRRiHzXR+nyihXt7EBIeEXpxs/H7bHXKzupL4M6P+ 25hGF8Ir/s0LRJkGzvbqnyezpPakR/zez51O6WMq9Qj7TpmEhekBYP90iBcz2jG0UoG8 cChjlciIIc12Pz/IX2WYAryuwwE7wOb0AXKPItEorvG058wEURBbOTtjS6S0OzxFd+Vo 8ZWA== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:arc-authentication-results; bh=/Smfb3E1lP+BBV6e+BM1TP/v0N6mezkwPmoushyE8O0=; b=0rafO4xN2k+Ws146fxEgZhW6j6pQIE9buiq32y7D0dQFBdTQI9NhV9QZwuOmCR/Mk5 E1bMcWScvBUKXdsMToxE3mwxH/35WBjnTU104fevoZtKEcmUGuh39jO0OiyxCYqrjmKd xQw8sjMTcmfq+VBH/0T+B5aM8hTQyZTee/sPMenN9RqujSbbmeYkxODhzH1Ld+h0YR4A /KGA6Z759B5v1p9t1XHfLbH8srDn1e47Kqs1YYWjOHTzHQjxeudtt8qLFRMIa+EQ4CBU mSw05biUe0tLl6qpQLBeZOhDFkX18vpV6Pd2kYZJcJyxKSGhh9/lef2l3Y1PXYvH5cFa QYng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Fp1MFv19; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7-v6si3328887plh.806.2018.03.01.10.17.41; Thu, 01 Mar 2018 10:17:56 -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=pass header.i=@gmail.com header.s=20161025 header.b=Fp1MFv19; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033841AbeCASQw (ORCPT + 99 others); Thu, 1 Mar 2018 13:16:52 -0500 Received: from mail-pl0-f46.google.com ([209.85.160.46]:44879 "EHLO mail-pl0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033321AbeCASQv (ORCPT ); Thu, 1 Mar 2018 13:16:51 -0500 Received: by mail-pl0-f46.google.com with SMTP id w21-v6so4104923plp.11 for ; Thu, 01 Mar 2018 10:16:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=/Smfb3E1lP+BBV6e+BM1TP/v0N6mezkwPmoushyE8O0=; b=Fp1MFv191+imdwn4XiwK0NWQ72BAcXXWJa0fb8TGEuV2U+Yv5g96ndxG0zKIlvvt5v Mwr2YwguvG4MIIrwOyTR0vgqmW2c0l4i5zi8yUxC0EKjv8Iq/qJzCrASC7K9dU1in5/G LGkA9q++udB3Dx6A3PmLJK091tJtGDU57DLurYkaBhhzorzol4T2v1BFrn+R3AScQoIj 1LO1+vBLtCs2AvBx7ALGC3YK6baZqDTXKddThV8aNVWnCUOAZjoqtuFw3ClNwSSBvIz3 tEPjXXO7twAI9N1twF8wk078ySC5EhLSStjuSAC22abv65wDIUrZ+vufB8WJ2UZRvgTj QxcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=/Smfb3E1lP+BBV6e+BM1TP/v0N6mezkwPmoushyE8O0=; b=AzwlRrQIep21wjJ5rIDqR5+9zPbZQUlGEm80HU8BDaEMIjfjwIxEg/0+aImqo2TYF8 c4HN/w3OCKA1dGaeTWOpS47gNstnZiBh8ZZ91TxUwtl2MaqdFZlHE5xBrgwY//0oX+ia 9Xp5/M5kmPql4NoGBknebe3y4NJhodUoU6HZiV58iSMYgebXe9NLK8YImyJxiDRbHkM/ dDrq5C/ue3TK/0OVP/er0eQsoMsqhPuFuMxd81m7CDxQN/BTp7KP3lF5oP61IRRT38Nt wxYJW8KX3fC6Mw1BbxFZa4Qk2WAgyLr75O868Ryq48loF6usjlfld2w4sXXCMeZVGial NYwA== X-Gm-Message-State: APf1xPDxhoPyJ5T3vwvHVB8d+he+tV/uAn6SxIJSGp0X8eaSgpjvb9lA BGDXO/FBg8A2Lfa3a4gt4WM= X-Received: by 2002:a17:902:720b:: with SMTP id ba11-v6mr2768761plb.148.1519928210880; Thu, 01 Mar 2018 10:16:50 -0800 (PST) Received: from edumazet-glaptop3.lan (c-67-180-167-114.hsd1.ca.comcast.net. [67.180.167.114]) by smtp.googlemail.com with ESMTPSA id p14sm7910296pgu.44.2018.03.01.10.16.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Mar 2018 10:16:50 -0800 (PST) Message-ID: <1519928208.11375.3.camel@gmail.com> Subject: Re: Use higher-order pages in vmalloc From: Eric Dumazet To: Michal Hocko , Andy Lutomirski Cc: Matthew Wilcox , Dave Hansen , Konstantin Khlebnikov , LKML , Christoph Hellwig , Linux-MM , Andrew Morton , "Kirill A. Shutemov" Date: Thu, 01 Mar 2018 10:16:48 -0800 In-Reply-To: <20180223121300.GU30681@dhcp22.suse.cz> References: <151670492223.658225.4605377710524021456.stgit@buzz> <151670493255.658225.2881484505285363395.stgit@buzz> <20180221154214.GA4167@bombadil.infradead.org> <20180221170129.GB27687@bombadil.infradead.org> <20180222065943.GA30681@dhcp22.suse.cz> <20180222122254.GA22703@bombadil.infradead.org> <20180222133643.GJ30681@dhcp22.suse.cz> <20180223121300.GU30681@dhcp22.suse.cz> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2018-02-23 at 13:13 +0100, Michal Hocko wrote: > On Thu 22-02-18 19:01:35, Andy Lutomirski wrote: > > On Thu, Feb 22, 2018 at 1:36 PM, Michal Hocko wrote: > > > On Thu 22-02-18 04:22:54, Matthew Wilcox wrote: > > > > On Thu, Feb 22, 2018 at 07:59:43AM +0100, Michal Hocko wrote: > > > > > On Wed 21-02-18 09:01:29, Matthew Wilcox wrote: > > > > > > 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. > > > > > > > > I was wondering about that possibility. If we want to migrate a page > > > > then we have to shoot down the PTE across all CPUs, copy the data to the > > > > new page, and insert the new PTE. Copying 4kB doesn't take long; if you > > > > have 12GB/s (current example on Wikipedia: dual-channel memory and one > > > > DDR2-800 module per channel gives a theoretical bandwidth of 12.8GB/s) > > > > then we should be able to copy a page in 666ns). So there's no problem > > > > holding a spinlock for it. > > > > > > > > But we can't handle a fault in vmalloc space today. It's handled in > > > > arch-specific code, see vmalloc_fault() in arch/x86/mm/fault.c > > > > If we're going to do this, it'll have to be something arches opt into > > > > because I'm not taking on the job of fixing every architecture! > > > > > > yes. > > > > On x86, if you shoot down the PTE for the current stack, you're dead. > > vmalloc_fault() might not even be called. Instead we hit > > do_double_fault(), and the manual warns extremely strongly against > > trying to recover, and, in this case, I agree with the SDM. If you > > actually want this to work, there needs to be a special IPI broadcast > > to the task in question (with appropriate synchronization) that calls > > magic arch code that does the switcheroo. > > Why cannot we use the pte swap entry trick also for vmalloc migration. > I haven't explored this path at all, to be honest. > > > Didn't someone (Christoph?) have a patch to teach the page allocator > > to give high-order allocations if available and otherwise fall back to > > low order? > > Do you mean kvmalloc? I sent something last year but had not finished the patch series :/ https://marc.info/?l=linux-kernel&m=148233423610544&w=2