Received: by 10.223.185.116 with SMTP id b49csp618417wrg; Fri, 23 Feb 2018 04:13:57 -0800 (PST) X-Google-Smtp-Source: AH8x224BQ0G60EO7rPOqMN5pDXfSp1BQnm2XBAfGvdgQOZeNqQnFejxj/o3OU6eV9gB7owUfdOSd X-Received: by 10.99.0.147 with SMTP id 141mr1314260pga.364.1519388037533; Fri, 23 Feb 2018 04:13:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519388037; cv=none; d=google.com; s=arc-20160816; b=vvJKkYfQQATPnjMxCzXFF8rpzm2kprG9KR8JvieMBdV5tHfjIirSlDIwe6XZ2jdJ/F tU0aQ4KXB9RLpAmRv/lkL7m21jJ3AfYr6ctXaZ6xEgZAMB9hs3G0Lq7hH3obo6w/gbz/ EyXxSkcNHdOKy8LKqff1yrv+FV3vL2sq2E4ZunlBnSIvZMh1gGWUrY/0MnfAMo40hOeL kqA3VYyABdczKz60i6I1k4WPCuzrQjqn/mFDJ+gFaCGQqlowRpo4NuFlHJ6N2k9U+9ij YJTq0KbTaKfKQ/1BlDgnQYGXgEbi63XUsklWaQSy0pcvMp52nygv2Ej1oUDAByIljCN3 r16g== 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=WjAW/2XHrmb0e2YoQWPcuB5Y3VefK7IKfuggeGiI6Og=; b=w4omFnLoWdAty75o1QM0p2565tYEFX+tnaQDERUkuc0wuBgoxGMZF8RwHOe2ABtZk7 mtaWsgm3eZ8FFIAcDfqa0Qma8GMcPMMfUr/cpqbERWzO/aP8I3Io6rS1+xVpHPSXJb3O aqlgoDFI4ObEQ99TxvSCXrv5Dn7CG1Kj1+51SrAniLEAziT7Sv1vUFuj2tRO8+x1Y2JB TKW6ryouHzlSYQlyQericcPqFfV3bY8nF4TSCw8taP8GfLE7zld2e5glghjyQuuOiLNE jan3Ut86Oiom83BUAZh0tRpBjtAMaGg9EJmLRMciTEdhyDOIDcQKUkO/Gk1q3ppFv9b+ dZVA== 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 a71si1441500pge.378.2018.02.23.04.13.42; Fri, 23 Feb 2018 04:13:57 -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 S1751402AbeBWMNE (ORCPT + 99 others); Fri, 23 Feb 2018 07:13:04 -0500 Received: from mx2.suse.de ([195.135.220.15]:54933 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751273AbeBWMND (ORCPT ); Fri, 23 Feb 2018 07:13:03 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CECE5ACD2; Fri, 23 Feb 2018 12:13:01 +0000 (UTC) Date: Fri, 23 Feb 2018 13:13:00 +0100 From: Michal Hocko To: Andy Lutomirski Cc: Matthew Wilcox , Dave Hansen , Konstantin Khlebnikov , LKML , Christoph Hellwig , Linux-MM , Andrew Morton , "Kirill A. Shutemov" Subject: Re: Use higher-order pages in vmalloc Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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? -- Michal Hocko SUSE Labs