Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp80602ybk; Fri, 8 May 2020 14:35:33 -0700 (PDT) X-Google-Smtp-Source: APiQypLQMr4mn6QHY4wI5INEu2deadZInhCtZNipKtyccmA83woy5fmM1Jxbyp9CgqcER05RLYgQ X-Received: by 2002:a50:ee0e:: with SMTP id g14mr4082649eds.34.1588973733649; Fri, 08 May 2020 14:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588973733; cv=none; d=google.com; s=arc-20160816; b=qHc+qN1EsQuTZebzsvQku4G1xIcl//NorQowrxrH/SdiihdJf9RZZemBLcTvYosnG6 sD6hUznJMfwUvzYSIQmXYNiurvGGk+GJ3uuFjytqx0+cK01gHdrZuHRJLjFo46T+31ot tiFOdAcdcTDYPtJij/qg9D2Ng/bgSvAJLRExrbbIztSUvTDk//PZpm1UAzpdKMwvko8Z Z798jU8pMJ5Sy3LEOa5F5RGD7FcOtHWbcU8KO3ll4rWLGx5+PO6pONO4UPPhOUrksZLC cnVni9YFMrGNP4ndrcg4j+3rAQbjkpMgOhd9WcOQeX1xaeJHpSasmp9Qs1w+SxaMi3nT n7HQ== 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=g6GRIouhESEiK5nhIqDZxkShWriWJtJgbxLY1BCVxYE=; b=CpoTZIl6uo39/UcUoNOTZ599PzCoF7Cl7zMMkQX5RTiP1il0+ZPlKThIx6T9PQFXwS /07YuTvWEhAlLp1nEMehuCBdBy7q1bULs9UjZz0fz7AkbF/LarlJi9fJR0NRIfNLitBn JVGtx1ER8yrihSCr2GI8FkMWvJ3TXzkvV2PRgrNSbXTHds3IWqxsKoWq46MKNNsP4wBO HlNbqiQcGOMPJRkfuehizmOK/sHKq29jgHI/mAJbE0lfsQtMmj5z0kJyyll2QGBcfmLJ XROHSOpn4+hL1i1gXqJcQ7tyl7PmL8ZZaATWaTiZyeMiJA9RJUsXozg6Ba8b4WpIoWjc 60tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gBVpLpwX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j18si1605851edj.12.2020.05.08.14.35.10; Fri, 08 May 2020 14:35:33 -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=gBVpLpwX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728085AbgEHVdd (ORCPT + 99 others); Fri, 8 May 2020 17:33:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:60902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726811AbgEHVdd (ORCPT ); Fri, 8 May 2020 17:33:33 -0400 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9D2A0218AC for ; Fri, 8 May 2020 21:33:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588973612; bh=ls4wVLtCuwHy+Ipjb7HA8vnN9MIN6Wmha+TzdYWtvKc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gBVpLpwXRca7BENelAhzKtHTP/0ltdA9cJoheMTx1P4GyW0YBcsAYsIu5/ptrBmE/ 5ZYCqjdqz9W1h6SF0WHOpZ51JTE8WS5DAWl1OLoHkkSP4X4Q2k49GHJFDuzASlXEU1 dxGoIwGC35mqkkAFmxmQekt9VysyPL8x4IUAaMek= Received: by mail-wr1-f48.google.com with SMTP id z8so3589456wrw.3 for ; Fri, 08 May 2020 14:33:32 -0700 (PDT) X-Gm-Message-State: AGi0PubB/dZfVri1VwirwQkVaVg6TuaYGXqs45NehphvwH5x0JWlVW/y Gop1hC9mQUXQ6QdyulOYrt9mwMqNP0SDU7M5peb3Qw== X-Received: by 2002:adf:e586:: with SMTP id l6mr5031852wrm.184.1588973611034; Fri, 08 May 2020 14:33:31 -0700 (PDT) MIME-Version: 1.0 References: <20200508144043.13893-1-joro@8bytes.org> In-Reply-To: <20200508144043.13893-1-joro@8bytes.org> From: Andy Lutomirski Date: Fri, 8 May 2020 14:33:19 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 0/7] mm: Get rid of vmalloc_sync_(un)mappings() To: Joerg Roedel Cc: X86 ML , "H. Peter Anvin" , Dave Hansen , Andy Lutomirski , Peter Zijlstra , "Rafael J. Wysocki" , Arnd Bergmann , Andrew Morton , Steven Rostedt , Vlastimil Babka , Michal Hocko , Joerg Roedel , LKML , Linux ACPI , linux-arch , Linux-MM 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 Fri, May 8, 2020 at 7:40 AM Joerg Roedel wrote: > > Hi, > > after the recent issue with vmalloc and tracing code[1] on x86 and a > long history of previous issues related to the vmalloc_sync_mappings() > interface, I thought the time has come to remove it. Please > see [2], [3], and [4] for some other issues in the past. > > The patches are based on v5.7-rc4 and add tracking of page-table > directory changes to the vmalloc and ioremap code. Depending on which > page-table levels changes have been made, a new per-arch function is > called: arch_sync_kernel_mappings(). > > On x86-64 with 4-level paging, this function will not be called more > than 64 times in a systems runtime (because vmalloc-space takes 64 PGD > entries which are only populated, but never cleared). What's the maximum on other system types? It might make more sense to take the memory hit and pre-populate all the tables at boot so we never have to sync them.