Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1604461ybg; Thu, 4 Jun 2020 14:11:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwX34r6lEFUhs8DTZ2cCZG09pFn/o31QZ47zzcsuRH4wuCgV+V0xQfW/9st6t2zIq6pzCv3 X-Received: by 2002:a17:906:468e:: with SMTP id a14mr5549100ejr.124.1591305064899; Thu, 04 Jun 2020 14:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591305064; cv=none; d=google.com; s=arc-20160816; b=E+96ZKpiOZch9mCTs2jnzR40K901Kphcgg1ir765nbfTfoIB2hlP7IiQ2PVfB1IBLe zdvzyk/sh5fyBvQI1YTra8Rb1eNJ09J5NRhYudg7gdJs8lIZGdm5Ai6r1PnuRQJFUWU4 f03XW2cISa1O2D5MEd2uWwQ3LUoinijwyA5BzCFNDMjwDHKIUhbIM31dAaod54OmBBiT pJn6RfbKrqOpSNotKUmT+MgcLKP81XloIKj2HqQ1mmTYA/D+28trs6NMdJUwk1M+7uDQ QFUDDDTzBkFvO1uzqN3yyj/MgkYL5xRxtJHIX5U9+tQDBtPGsJu4lJeGQRMH/b9rhAKh bm4g== 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:message-id:subject:cc:to:from:date :dkim-signature; bh=B8qB/DuyFaYp475nhxgvIiLuUpVvJA9xpG+FDpnJTWU=; b=Bl34HLCWCtWhfQQ850hMNQwassSMRjpTW+NuB9ARMJ0XmSMBL3gsuqoyi/W3VQXH9l akbi+IwzJbu7FY5pQMEPAJCDzimWStio61W9Kyrdie1liA+z9uKq1bpUfe46eGY87M7O e9ZQf/JrVauEJbqIoRqGB7x12r0TJkC0GJZ47p6VerAvRPcjLf7t6E+IQF638TV2rf6U kakgkSku/CcA6Hs1HIcmiRN7mjJFJRygeSHVYxyUbhrR8mNT6f+8iybp9t+l5RQb7hln Zb2X8OQ5gN5rEiPln4XiQcDWHbNwn0RN//9/oGPgxKSz4iErVW0tCXKU8k8aeNr+I8qJ 4GLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i3ShVfqi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z9si2265419ejm.47.2020.06.04.14.10.40; Thu, 04 Jun 2020 14:11:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i3ShVfqi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726146AbgFDVGS (ORCPT + 99 others); Thu, 4 Jun 2020 17:06:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:46248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725952AbgFDVGS (ORCPT ); Thu, 4 Jun 2020 17:06:18 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 99FC92067B; Thu, 4 Jun 2020 21:06:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591304777; bh=KbEg3kYnbQKCatClm2Pm8yun8OfgGLWbhLU6TLlAOeY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=i3ShVfqi5ptVJ/Uj2E1JiTm/xUpO4tgXwyhnoSRsSSlADuUf81XhIx1Q2US4DR5G9 e9rGKY3wgTpcO9B9R7nIKEFaTxq4aZNTQQ5difxN/BVzlKz1tHUbSUbsVNNlRNnKga 3K1KRx22usq+EAd4IFJCUKzaHJmJ7lh2+nMyFYes= Date: Thu, 4 Jun 2020 14:06:17 -0700 From: Andrew Morton To: Linus Torvalds Cc: Joerg Roedel , Guenter Roeck , Andy Lutomirski , Peter Zijlstra , Linux Kernel Mailing List Subject: Re: [PATCH] mm/vmalloc: track which page-table levels were modified Message-Id: <20200604140617.e340dd507ee68b0a05bd21cb@linux-foundation.org> In-Reply-To: References: <20200603232311.GA205619@roeck-us.net> <20200604083512.GN6857@suse.de> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 4 Jun 2020 10:16:07 -0700 Linus Torvalds wrote: > On Thu, Jun 4, 2020 at 1:35 AM Joerg Roedel wrote: > > > > I posted the fix for this already: > > > > https://lore.kernel.org/lkml/20200604074446.23944-1-joro@8bytes.org/ > > Ugh. > > I was going to apply this directly, but as I looked at the patch I > just found it fairly illegible. > > Is there some reason why the 5level-fixup.h versions use that > very-hard-to-follow macro, rather than the inline functions that the > main mm.h file uses? > > I'm _assuming_ it's because it gets included in some place where not > everything is defined yet, so making it a macro means that it works > (later on) when everything has come together.. > > But the solution to that would seem to make all the p.._alloc_track() > macros just be in a different header file, and make them be all > together. We already have that > > #if !__ARCH_HAS_5LEVEL_HACK > > in linux/mm.h, so it's not like we really have isolated that issue > into just 5level-fixup.h anyway, and creating a new > header that has all the variations in one > place, and that is only included by the two (!) users of these things > would seem to be a good idea regardless. > > Because is included by pretty much everything. Why do we > have those alloc_track functions defined in such a common header when > they are _so_ special? > > Please? I'd obviously like this to be fixed on ppc asap, but I'd also > like the fix to improve on the current somewhat confusing situation.. > > For extra point, the p??_alloc_track() functions could even be > generated from a macro pattern, because the pattern is pretty much set > in stone. > > I think the only thing that really differs is the types and the > PGTBL_xyz_MODIFIED mask, and which entry is tested for "none" (which > is also the only thing that makes the 5level fixup case different - > no? As discussed over in https://lore.kernel.org/linux-mm/20200604164814.GA7600@kernel.org/, Mike's "mm: remove __ARCH_HAS_5LEVEL_HACK" patchset (http://lkml.kernel.org/r/20200414153455.21744-1-rppt@kernel.org) is expected to fix this. 5level-fixup.h gets removed. I hope to have that patchset sent over later today.