From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61A09C433DB for ; Fri, 29 Jan 2021 19:27:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CE6BC64E06 for ; Fri, 29 Jan 2021 19:27:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE6BC64E06 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 25E218D0002; Fri, 29 Jan 2021 14:27:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 20D9C8D0001; Fri, 29 Jan 2021 14:27:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D5FA8D0002; Fri, 29 Jan 2021 14:27:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id EBD388D0001 for ; Fri, 29 Jan 2021 14:27:17 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 9999F3637 for ; Fri, 29 Jan 2021 19:27:17 +0000 (UTC) X-FDA: 77759796114.05.hand09_5f0286a275aa Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 7C5B8180364F1 for ; Fri, 29 Jan 2021 19:27:17 +0000 (UTC) X-HE-Tag: hand09_5f0286a275aa X-Filterd-Recvd-Size: 4747 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Fri, 29 Jan 2021 19:27:16 +0000 (UTC) Received: by mail-qv1-f49.google.com with SMTP id es14so5003852qvb.3 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=AxaH2C/NBpaken69uMEo7yga3/CQucDx4je7X82+lSv+6BmpcPr95aMqD0fTQTJaml p9Sw1dY3VJg41pomnZHKFLDPfhLTdxV2juti7Oayxbs1JObUlsFZxu3WEe8Mt6gU4bIp B3nhGLVaM399pkuUuODpCCkIWbvtPV7nF6hVufaBndSHVQH3Egl0DqiFcWtk7CYbSZJg 5AhDSZ0x/o8VX3TXJQTB74sOMSbQVid81ZOTk8iGM95q4IkQONiFyq5Q4Oqkk1UckYuH O5Kj+wyNZed7VH+tg2ebPXMEjPNu78bjbVDhIQhqelVLWPYuwOTWZuxFPlmGvHV/XySj hS8g== X-Gm-Message-State: AOAM531ORf+tSvpJA6wcBsa6Nj7R/uBJVdTiQ67AcWPkjNUr4BPyKd1h uplfvaCbG1SpMencbV120z9NXA== X-Google-Smtp-Source: ABdhPJy1FKErBXTLTJSPKr6EhyRWTnTFZJmnrgy0+6EE386XpEm0z8xqzmrUpr/E7WVv1dEVmDQbnQ== 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> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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