Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1564029ybg; Thu, 4 Jun 2020 12:59:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz791fmXRJ62Aqos8Qk7Afv5bI5FbXnV964A+s3lKOkJY4hbw3yIMm18CszHeXYgr0dgGeJ X-Received: by 2002:aa7:cd4b:: with SMTP id v11mr6126098edw.356.1591300792103; Thu, 04 Jun 2020 12:59:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591300792; cv=none; d=google.com; s=arc-20160816; b=m8Au8tmw3Bt3IrMxK8YvNqYW0EBPQqDh+hWCOyZOBx41QwvOGzAT0c5jAo+SqiqewQ ZEGNWsq5EHkjR9UR+xatc5OFZ77muSfsqAfnMkRsrorLjq2dzeodOi24wZrJMrsZ6NEf AvBJ/qwOgaQuig5UcMoQaAjQNDbIExgZJCwloxCK8jvwku+fQhIURtjllvJWtBG2dMkm TVOE4tVEhZel4v7yBPDdtZOtQQibBMD38SG6gweDTtJ7LEo6jQmur3XX39tL6LP0R18Y HsZD9xZ7yb0d41AE4VMEQ3TPS1xzJAwKK9J7ZMPI3l8KBJ5XEHeEnoYvCkceGQWpZDEN rV+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=H8kZFr8TiFC27H3w+X6ZCuLeuTOqZ7+EkG9BgkcWmiE=; b=zixHjsr23iO/NXV+69MjFwrM+rHwLTcqqsZ9Gr0IzvzOnqZ7uxZFECbxw/soaJKXDA PiCuvKkYGhS6yTosZqPGzsR9ARk5qjrQ7EV3XxhBNuPlJc+bYW8uagilPgQw+zLhzb4b KDFXfSrHATH/630qEQa8dn3PB6EGGaNwPsoPkel8W6rlzCfSiecgz0Pf1hvI4ycoufLL 1QD9+BOJpxkp1e91b6dAEi1EA9j9FX+LD+XRyF+1mdqgUy5oZpup3dc1m04b1iYsws+5 7vzBovxSy0KwKOJY02I2xacHRopLcxhIgw/IWtT5LIQ6GobqIjiqhU4+aRJ/R8ju3qOn bW6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=C7WSNRoJ; 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 b101si2317614edf.579.2020.06.04.12.59.29; Thu, 04 Jun 2020 12:59:52 -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=@linux-foundation.org header.s=google header.b=C7WSNRoJ; 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 S1730064AbgFDRQa (ORCPT + 99 others); Thu, 4 Jun 2020 13:16:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730051AbgFDRQ3 (ORCPT ); Thu, 4 Jun 2020 13:16:29 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F14AAC08C5C0 for ; Thu, 4 Jun 2020 10:16:28 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id z18so8228439lji.12 for ; Thu, 04 Jun 2020 10:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=H8kZFr8TiFC27H3w+X6ZCuLeuTOqZ7+EkG9BgkcWmiE=; b=C7WSNRoJag77E7M3JA5+YgLnjPBrdf00/5milKzOk0Mh/stV1wcQhNQM4qki+qew6e qTIrXsmck8Bd578raZvZGYMwEnRTiJv8DVaKRWk4F96h/ntvJqbdECJtT+SYCc2UAQYn 6031MrSwuK2KLCneeH6uAJNVSwh5GMCXyqoqw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=H8kZFr8TiFC27H3w+X6ZCuLeuTOqZ7+EkG9BgkcWmiE=; b=gulrlx2ZeYRoOX9YxkbyW+4u3zAgBkkodnJ7k6E2gOzur4kqq1heZk4KQCZ38/0JtY USqWHhp9O910kpvsHr7WPQE4u5ueyKT036PUIZA8qRGaMBE1gBiWDxDPUdbLp2CzM9Vi cjEsv9WpXF0o+F3aNS3tlML01h6g0EzrHIH1QYlmxPOuu1O7m69UlwsWJk4xjmULUB/c YvhJXr8KjR74giVjFtqhNbCxvOIgxo2nChd6OYXKB6fHANzZlvo+/u3I3g4ThvuE85l8 L6tQUCjN+8zJJm3r9W+OtH+92J2IjMsO4wS4NdQEF6McbdwYz+QMVguhrzx44ojZMVPR kZSg== X-Gm-Message-State: AOAM533iMh7dPF0aOWZZV0wdrDPmLRId5+nfyT1aL+j1cyJV1Oh4UARa SHjUvOUHqovzHYT9UI7+SQF9Aag8NFg= X-Received: by 2002:a2e:b612:: with SMTP id r18mr2521993ljn.195.1591290986304; Thu, 04 Jun 2020 10:16:26 -0700 (PDT) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com. [209.85.208.169]) by smtp.gmail.com with ESMTPSA id c8sm55581lfc.46.2020.06.04.10.16.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Jun 2020 10:16:25 -0700 (PDT) Received: by mail-lj1-f169.google.com with SMTP id a9so4726950ljn.6 for ; Thu, 04 Jun 2020 10:16:24 -0700 (PDT) X-Received: by 2002:a05:651c:2c6:: with SMTP id f6mr2563945ljo.371.1591290984015; Thu, 04 Jun 2020 10:16:24 -0700 (PDT) MIME-Version: 1.0 References: <20200603232311.GA205619@roeck-us.net> <20200604083512.GN6857@suse.de> In-Reply-To: <20200604083512.GN6857@suse.de> From: Linus Torvalds Date: Thu, 4 Jun 2020 10:16:07 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm/vmalloc: track which page-table levels were modified To: Joerg Roedel Cc: Guenter Roeck , Andrew Morton , Andy Lutomirski , Peter Zijlstra , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Linus