Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2044359pxb; Fri, 29 Jan 2021 11:29:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/hV7N1Dcrl0a2kUzncoBcYr6JIwOteUHJ9/ajxKrZlXXq8TVMt7kua4VvTrRkDs7Y+8Ox X-Received: by 2002:a05:6402:35c2:: with SMTP id z2mr6914667edc.34.1611948570192; Fri, 29 Jan 2021 11:29:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611948570; cv=none; d=google.com; s=arc-20160816; b=gscUj3Q82TJ1WuowSRIQza18hnfb5LDJRdDdHJRK9ZZmKHyR4aGbwGFfmecfOuxyUt ctksd9NCc0zdvS4L+wP6MRNWooFwSqMbXnNGwUVxYOJWT+lPLBQ77DyIikTOpEsTGSpp A2f0H8IMv5GRinG+ESfauHF6W9nDx4M7IWD+L3yZV2xAB6e9++XXk7AeTBL6bEwFXre5 MCNehPqWn9nB1/D0an50umRdzRBUp/oiLIBnO5HW6blSmDIw91vcAmR9kx0zqb53s8UV b9y5p5cUH/FYQHv03EsuVH3mFQEUlWtYZJCI4Dscz5ZfpX1hwdpndtktqBmPw6PfHhEM bUeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=W2ghzd/CLjNAIxuHclEmxfn8E0lo4q/ihR7kL0nL0Qo=; b=vNBZESz4aLfVTUEqDq1GI4+DiNNYT09vuM+k/e6ygKOeWfCi2hzKtVaxZJ6sNoMtEm w4lxA07xUPcsoLHCqNFy6ZENnvUJisd1Q8FqEXWS8Ju1uynBh9NtBrHB2KAUmK+JAiD3 o58qYIbxlvagFHPiJK72obYpkVToBWF5mc7CvLESY/w07PRzhPThCiqsu77FU5NwBAhX WkD6Mdjxuerj3l9kyvih0Ts5Swv8wB+Zt7uIHPKl+p1bvWnIyzw9+cDLwfobCIi3I0r9 aIFVRu5FJYNbaVrr54tPk+YD+/rD99bAHsLqQrSY3oJAddp+jy6tFnH49LQKuKtoorzG O/mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=dx4px5JI; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r9si5357761eji.723.2021.01.29.11.29.05; Fri, 29 Jan 2021 11:29:30 -0800 (PST) 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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=dx4px5JI; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232997AbhA2T17 (ORCPT + 99 others); Fri, 29 Jan 2021 14:27:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232630AbhA2T15 (ORCPT ); Fri, 29 Jan 2021 14:27:57 -0500 Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B48FCC061573 for ; Fri, 29 Jan 2021 11:27:16 -0800 (PST) Received: by mail-qv1-xf2a.google.com with SMTP id ew18so5004876qvb.4 for ; Fri, 29 Jan 2021 11:27:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=W2ghzd/CLjNAIxuHclEmxfn8E0lo4q/ihR7kL0nL0Qo=; b=dx4px5JIWtlW+hXmDMfsh0lbw2eBI/HqPO96aQv/XbR7nIF2lDFu+76hEaEoSF8kEq VBfB9ud9n6WozMQMD7kajGwHWGWTiLfmBSAfGs73f3Dj+32DfTUxwO5PEz/2rr/LShhB g6J2ynSIT9QelMj4qT7P/Qt3ghjyircEwYkY0GnSrWVPmKAaBR50atAEjtECMw2Htut+ EIPV5t1U/O5B5n8amw+LRIQiXOqFaca051F7+F/Pg643XJt3FDDMPH6TLAbc85n2Zgfx g6ox9l9OkZxhi49dsVUWgIqpVM9PhWTbksGCVNqFLzxj2XpuzPC25S+cZwkv5rCuomIT UwMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=W2ghzd/CLjNAIxuHclEmxfn8E0lo4q/ihR7kL0nL0Qo=; b=MSd+BPFO8D0qnMQOwtmHQ/mqM4D6DCofZkC73Hj8cmcovhNavTZKliWah6CkBenVDE 3fo5Z7q6w2QXPeE9CHynv4digUL+JkEYxlf6m4S1kzlkwzUOA8wzQ8b4aPbml6bd+gZS eaFJC/X0NkwP6smi7mPAxeVydK7P3C0l7duPHHR1Ph8C59/oEwttRzazlMOp2vtoD6vY pI2Llcfwr9wdLilD/DvjHXhXv1yfR85nL39lbvvrS22c5fJ/sjTbgQir7PdspMdRIqdO r+qDlRw7WlH7NklV+2t0NUFw385qxRt5CgOgbww+MhsOruH4SLtnRv8pnuItunoZZMyB 9LrQ== X-Gm-Message-State: AOAM531UgomvoSt/OC7GeINVrg1d900gz+ghGgE/mRerIgw5ODG4Jayn GTCUKj1r8TUBS9+odp6GwC/Ecg== X-Received: by 2002:a0c:f481:: with SMTP id i1mr5384974qvm.50.1611948435943; Fri, 29 Jan 2021 11:27:15 -0800 (PST) Received: from localhost ([2620:10d:c091:480::1:f735]) by smtp.gmail.com with ESMTPSA id s129sm2687878qkh.37.2021.01.29.11.27.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jan 2021 11:27:15 -0800 (PST) Date: Fri, 29 Jan 2021 14:27:13 -0500 From: Johannes Weiner To: Saravanan D Cc: x86@kernel.org, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, willy@infradead.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, linux-mm@kvack.org, songliubraving@fb.com, tj@kernel.org Subject: Re: [PATCH V6] x86/mm: Tracking linear mapping split events Message-ID: References: <20210128212048.oopcyfdf4j2lc663@devvm1945.atn0.facebook.com> <20210128233430.1460964-1-saravanand@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210128233430.1460964-1-saravanand@fb.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 28, 2021 at 03:34:30PM -0800, Saravanan D wrote: > To help with debugging the sluggishness caused by TLB miss/reload, > we introduce monotonic hugepage [direct mapped] split event counts since > system state: SYSTEM_RUNNING to be displayed as part of > /proc/vmstat in x86 servers > > The lifetime split event information will be displayed at the bottom of > /proc/vmstat > .... > swap_ra 0 > swap_ra_hit 0 > direct_map_level2_splits 94 > direct_map_level3_splits 4 > nr_unstable 0 > .... > > One of the many lasting sources of direct hugepage splits is kernel > tracing (kprobes, tracepoints). > > Note that the kernel's code segment [512 MB] points to the same > physical addresses that have been already mapped in the kernel's > direct mapping range. > > Source : Documentation/x86/x86_64/mm.rst > > When we enable kernel tracing, the kernel has to modify > attributes/permissions > of the text segment hugepages that are direct mapped causing them to > split. > > Kernel's direct mapped hugepages do not coalesce back after split and > remain in place for the remainder of the lifetime. > > An instance of direct page splits when we turn on > dynamic kernel tracing > .... > cat /proc/vmstat | grep -i direct_map_level > direct_map_level2_splits 784 > direct_map_level3_splits 12 > bpftrace -e 'tracepoint:raw_syscalls:sys_enter { @ [pid, comm] = > count(); }' > cat /proc/vmstat | grep -i > direct_map_level > direct_map_level2_splits 789 > direct_map_level3_splits 12 > .... > > Signed-off-by: Saravanan D Acked-by: Johannes Weiner