Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4455609ybi; Fri, 19 Jul 2019 23:17:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIPfOP9M3CtKuwYRo6g1YqiIWnHiw8fBnN1CZDe5dWLl2gt6jmV19bz7BIEzbOQCzoiZOX X-Received: by 2002:a17:902:110b:: with SMTP id d11mr64074332pla.213.1563603470916; Fri, 19 Jul 2019 23:17:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563603470; cv=none; d=google.com; s=arc-20160816; b=YcMHc2U941M2heACv0Wv8DOszdGT53fVk3SK+Mwqcq5TXT4huPaWgfDiEZllL+gOQq pfqUHWiYEBUjdF0RMj/7qpktzZyOu4c1j5kCGD8IQy4p6qG+gdjjNdYYjdUUdgoKQAF+ RUYBStHeS0EpVegFlB1NIgYFd/m5tuOSqOL6aj0UdLGx3eYsnYub4UwEx1IyWecphEL5 PtZFipHKMXc4P+K5dsXgEOStZwUpDqYpB6ElL/x1Wp7EQo+eUlHKZ786+HSXBY30K2B+ QAJJL+dT/ZMc3zhwQ3chUI4zTkSV8LrA1s9AG+8UW+pXwE15V0qMCKYvSp5l59mfXONh mp5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=m5h/HWMkWy82+caoCNnuAqYR0Q1sxxFcpG9vAPTPhIk=; b=hVKHZpump+AOaBzA1ZoMV8eOLaKCIgwaZHtw240jrz2f0ElJL6jrmnTcX7qMkblSn1 oEM0rBJOSxGOOu8agODBSJvVM0yTyDUlX/GV45t8iPauVvb/3mmrNhnxWrJ3hcFAhlcn CWTeDLu6sZgUIgXU7imzIsN2bfGC+auodqhH1P3R1AMCoyhlV377uN1JSaSNOega9Ul/ sD2zKxV5iNL94wFo8AX4rRQZvoPknbJsGrxWuyB92nqjGuUzFHbLbz0cRDo5rzIruLDS j6PDCrSnh4tcIz6ag3WPhufDT+mwtmmZBJk9B1BIjlwvHFTZo5GWTrUHvVUbg1CygWqx wsDw== 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 t18si1621082plo.328.2019.07.19.23.17.18; Fri, 19 Jul 2019 23:17:50 -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 S2388561AbfGSVK5 (ORCPT + 99 others); Fri, 19 Jul 2019 17:10:57 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:32861 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727910AbfGSVK4 (ORCPT ); Fri, 19 Jul 2019 17:10:56 -0400 Received: from pd9ef1cb8.dip0.t-ipconnect.de ([217.239.28.184] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hoa9N-0004hk-UE; Fri, 19 Jul 2019 23:10:46 +0200 Date: Fri, 19 Jul 2019 23:10:45 +0200 (CEST) From: Thomas Gleixner To: Joerg Roedel cc: Joerg Roedel , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Ingo Molnar , Borislav Petkov , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 2/3] x86/mm: Sync also unmappings in vmalloc_sync_one() In-Reply-To: <20190719140122.GF19068@suse.de> Message-ID: References: <20190717071439.14261-1-joro@8bytes.org> <20190717071439.14261-3-joro@8bytes.org> <20190718084654.GF13091@suse.de> <20190719140122.GF19068@suse.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 19 Jul 2019, Joerg Roedel wrote: > On Thu, Jul 18, 2019 at 11:04:57AM +0200, Thomas Gleixner wrote: > > Joerg, > > > > On Thu, 18 Jul 2019, Joerg Roedel wrote: > > > On Wed, Jul 17, 2019 at 11:43:43PM +0200, Thomas Gleixner wrote: > > > > On Wed, 17 Jul 2019, Joerg Roedel wrote: > > > > > + > > > > > + if (!pmd_present(*pmd_k)) > > > > > + return NULL; > > > > > else > > > > > BUG_ON(pmd_pfn(*pmd) != pmd_pfn(*pmd_k)); > > > > > > > > So in case of unmap, this updates only the first entry in the pgd_list > > > > because vmalloc_sync_all() will break out of the iteration over pgd_list > > > > when NULL is returned from vmalloc_sync_one(). > > > > > > > > I'm surely missing something, but how is that supposed to sync _all_ page > > > > tables on unmap as the changelog claims? > > > > > > No, you are right, I missed that. It is a bug in this patch, the code > > > that breaks out of the loop in vmalloc_sync_all() needs to be removed as > > > well. Will do that in the next version. > > > > I assume that p4d/pud do not need the pmd treatment, but a comment > > explaining why would be appreciated. > > Actually there is already a comment in this function explaining why p4d > and pud don't need any treatment: > > /* > * set_pgd(pgd, *pgd_k); here would be useless on PAE > * and redundant with the set_pmd() on non-PAE. As would > * set_p4d/set_pud. > */ Indeed. Why did I think there was none? > I couldn't say it with less words :) It's perfectly fine. Thanks, tglx