Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2033712ybi; Thu, 18 Jul 2019 02:20:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwlkrLRkhZ1ou4bRyDe3Fwh/5WamzD1r1Nv59XQeGOwPsQBSqKw5UzPKUfFSORDC2a2T8F X-Received: by 2002:a17:90a:9f08:: with SMTP id n8mr50231464pjp.102.1563441612061; Thu, 18 Jul 2019 02:20:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563441612; cv=none; d=google.com; s=arc-20160816; b=aswIyVxJ80Q3nBal6Oq05wgH9xiroCN10hACa1KTiNovPeYu9pBB0x/14hkeZWowpT YkBGsSJzdeZdxw6mnSh+4ilWKwwhPH/XdKSudhFZjUXNTkQbyvQy84Q6oL1Knks7TgsP ZSOVUpZmA4nFT6Fy9RDqzK12hDdq++Hc33hqo0225OmUshGmrAmzr8ZCD79eMqOQxsSU B0N97lWEtNBK6GPBwLWVe9M4gGFhX3LOA2+AsEU+rlQH597fTDSUU2Xbr/nXDKlOqeqJ 0KTA3r+DOs65chTf0Ka8EMcjPoUEno/Ih1NPiIBcT6Sr8PT+UHVF3kXwWahImzmpqWJk pH1w== 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; bh=ma/PxcgtYZjPX40C5MK0DP9wyJE72ErwGTJH/OQlSaU=; b=VhRZHBzHeiDlg9imyqdstuoReqhX2IwkFEw5itCZK57s9a/xnSsuTSySqNZ6HNbZq1 ou2mJftaxjJYRrv2zJHAbJQSlF7NsbPiPm6DlzleksckWlX84kmmHD+tKWZikyZZx33h 9tKG9L8NgqWa4cQy4KYbAPgDAHtFPEgzszCxQsApZNLAPOhu+8IKHCoHs592x8fXl+29 3ra+MATig0ERtPKEYtqlRTh7T5YARf0MWI0L9A2UzQsq2wO0A/hTGQunj/OAmT90pGzA JX+V84spZbhPKX2PaZhY3ZpVFOdoHnOUZQyMDGUqO9bNn5PjAL4DYNNq931CMfSy8MJI 0kGg== 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 h36si2035588plb.199.2019.07.18.02.19.55; Thu, 18 Jul 2019 02:20:12 -0700 (PDT) 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 S1727702AbfGRJRs (ORCPT + 99 others); Thu, 18 Jul 2019 05:17:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:56048 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726423AbfGRJRs (ORCPT ); Thu, 18 Jul 2019 05:17:48 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 055D1AF77; Thu, 18 Jul 2019 09:17:47 +0000 (UTC) Date: Thu, 18 Jul 2019 11:17:45 +0200 From: Joerg Roedel To: Andy Lutomirski Cc: Joerg Roedel , Dave Hansen , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Andrew Morton , LKML , Linux-MM Subject: Re: [PATCH 3/3] mm/vmalloc: Sync unmappings in vunmap_page_range() Message-ID: <20190718091745.GG13091@suse.de> References: <20190717071439.14261-1-joro@8bytes.org> <20190717071439.14261-4-joro@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, On Wed, Jul 17, 2019 at 02:24:09PM -0700, Andy Lutomirski wrote: > On Wed, Jul 17, 2019 at 12:14 AM Joerg Roedel wrote: > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > > index 4fa8d84599b0..322b11a374fd 100644 > > --- a/mm/vmalloc.c > > +++ b/mm/vmalloc.c > > @@ -132,6 +132,8 @@ static void vunmap_page_range(unsigned long addr, unsigned long end) > > continue; > > vunmap_p4d_range(pgd, addr, next); > > } while (pgd++, addr = next, addr != end); > > + > > + vmalloc_sync_all(); > > } > > I'm confused. Shouldn't the code in _vm_unmap_aliases handle this? > As it stands, won't your patch hurt performance on x86_64? If x86_32 > is a special snowflake here, maybe flush_tlb_kernel_range() should > handle this? Imo this is the logical place to handle this. The code first unmaps the area from the init_mm page-table and then syncs that page-table to all other page-tables in the system, so one place to update the page-tables. Performance-wise it makes no difference if we put that into _vm_unmap_aliases(), as that is called in the vmunmap path too. But it is right that vmunmap/iounmap performance on x86-64 will decrease to some degree. If that is a problem for some workloads I can also implement a complete separate code-path which just syncs unmappings and is only implemented for x86-32 with !SHARED_KERNEL_PMD. Regards, Joerg