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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF421C77B73 for ; Thu, 13 Apr 2023 16:33:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EF07F6B0072; Thu, 13 Apr 2023 12:33:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA06F900003; Thu, 13 Apr 2023 12:33:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D681C900002; Thu, 13 Apr 2023 12:33:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C6ADD6B0072 for ; Thu, 13 Apr 2023 12:33:30 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 375F4AAC47 for ; Thu, 13 Apr 2023 16:33:30 +0000 (UTC) X-FDA: 80676913380.13.2B089CE Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by imf27.hostedemail.com (Postfix) with ESMTP id D605F4002A for ; Thu, 13 Apr 2023 16:33:27 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=devkernel.io header.s=fm1 header.b=ViQZJZIU; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=GO3ith22; spf=pass (imf27.hostedemail.com: domain of shr@devkernel.io designates 66.111.4.25 as permitted sender) smtp.mailfrom=shr@devkernel.io; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681403608; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=E7v8GvR/BA8ZybVtwk1BgUR7UNaro8OfYXIZQ2El7BY=; b=J6slgnyyuD0WOc6HFRD62sATciuW30LjWfeoRrtgCBEMjkmXjbqbKvAj9kZIX0053+Pt74 Nc72xqy7kO1uXU+63rfWK4ncic2Y8J1id5l3E1DAPI2hgOJoJij+jEkArxNZ3d49UD8E2c 3G/Np/Rfr5yd1xgYMHh1MQcYwZ69jxc= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=devkernel.io header.s=fm1 header.b=ViQZJZIU; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=GO3ith22; spf=pass (imf27.hostedemail.com: domain of shr@devkernel.io designates 66.111.4.25 as permitted sender) smtp.mailfrom=shr@devkernel.io; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681403608; a=rsa-sha256; cv=none; b=0m1Nokez6VOyuFOsZqHB0KVACH5tQTRq31XbeJXiXkuNU/fHLOZ/astCJyan2taOkIJaYj Ne2OyOTwZ0tsEXdLGdmpN48s6cUv6+hxgWV3/Xd4gP3NGmpJDll8FZ10PCbukyFuHQHxJD nST1RUuxPXdI46Veqw3GWqU8ZQnwWhU= Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 261CA5C00D1; Thu, 13 Apr 2023 12:33:27 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 13 Apr 2023 12:33:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devkernel.io; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1681403607; x=1681490007; bh=E7 v8GvR/BA8ZybVtwk1BgUR7UNaro8OfYXIZQ2El7BY=; b=ViQZJZIU22yTNfIXLP xff30J2t4m8/W4Cxx+Uv32Zj6vz41yqCPEbVWpXv1gvmj1lPhh5ikKTe0F5NBrPX 07Kw9by1MdmhjEixCyCg3c4a7j38kyNG5wJoWTdEDoVOZHleD2CNnE+kh5b9E6ze vuSTwIBiV2diADtLTlPRyWmIGYie5u/WuM8/vDpMBWxZAm0X463lzuklBNMOsZc2 p6L/39L43RxMkGdkVZsI8dO2ADwLBOpf69aUjIBdiiT/ecOGEok5hSoGetFQmH9G vABt4czEa++k/9PZ0P0G8ywTStOJqWaLgq2ZRVARy9GgZwmjap01zXFth/kwj2Z4 Fi/w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1681403607; x=1681490007; bh=E7v8GvR/BA8Zy bVtwk1BgUR7UNaro8OfYXIZQ2El7BY=; b=GO3ith22DKwoVSWx9DMWTK5XCro1D EZlVCZ5TANUiZreKwDmm8WsGdVvrv98eXVLItMdzSK8R/4+bn+1krYW8uY5lg66U Qb/tMzIh/0T/z+cO/rQMHBQ7HSjXV47XpFWtSN2YfSBeYiQtIk+qoCtGWuHiDGJQ va9xYVjR8OaYOtYiE0eRxe+CgoWkG26AOdWemJ88sHoxztzkhw+u0NQgx4P7P+yR 0eDV2YWP+P0+b83JKsdcbEfdGX7UZZ+xQ8XGXstsoMOoezsFeClj/QNOPO8H/9kg 7Rrh5DSSRYHDa0OFGr6SVf0/YjOZjQJTPUxrgmjifORYZmds16ZfWrdYQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdekkedguddtfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpehffgfhvfevufffjgfkgggtsehttdertddtredtnecuhfhrohhmpefuthgv fhgrnhcutfhovghstghhuceoshhhrhesuggvvhhkvghrnhgvlhdrihhoqeenucggtffrrg htthgvrhhnpedttdevfffgudeujefffeeutdekvddtffefleellefgfefgleejteeffedu geduteenucffohhmrghinhepthgvshhtshdrthhoohhlshenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehshhhrseguvghvkhgvrhhnvghlrdhi oh X-ME-Proxy: Feedback-ID: i84614614:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 13 Apr 2023 12:33:25 -0400 (EDT) References: <20230412031648.2206875-1-shr@devkernel.io> <20230412031648.2206875-4-shr@devkernel.io> <7c5606cc-ca58-c505-b0d3-2eec29fe606a@redhat.com> <190bed16-7b7b-a880-9793-cdeb1baef29d@redhat.com> User-agent: mu4e 1.10.1; emacs 28.2.50 From: Stefan Roesch To: David Hildenbrand Cc: kernel-team@fb.com, linux-mm@kvack.org, riel@surriel.com, mhocko@suse.com, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, akpm@linux-foundation.org, hannes@cmpxchg.org, willy@infradead.org, Bagas Sanjaya Subject: Re: [PATCH v6 3/3] selftests/mm: add new selftests for KSM Date: Thu, 13 Apr 2023 09:32:21 -0700 In-reply-to: <190bed16-7b7b-a880-9793-cdeb1baef29d@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D605F4002A X-Stat-Signature: kanr6sdzga7ndeuo5twwdqxgu46kyt6e X-HE-Tag: 1681403607-812137 X-HE-Meta: U2FsdGVkX1/zlSUXV3CKsQkegfzV1n6W0lAMOCiHCh2h1Fav8Ck9CHd6sNQBMtUWexxb90SvarJqfXgpK/xrj+OZrmIqF+corLaRhfCs0JHIA63bnF7HtNcJPecJUxaMp+4e5csJBvgtQygyZkBMYclv1s1/9hjMOHAbyab8G2Gkbr2f6ZlTzW3C+CxEgHXyY10OFqxv5xDK00gojvG15LyhlcMuzRS7RoC6zQ++ilSf4qblYjF6z80aNdYjRHLfqcQa+8bWHjA09PCgyl9Ohcfo2/vjj/igvI5JJqziaXFTtc6VONoDSP2ZSvPSjLCaJU+hoXM3eumdsNL3kEuHF/XB+PfAApyGFKB7+yCeBwJF0UPvgLk/MHWgU80YbeRfFKnDyY1CNjisSW/MPaYwqpRwqS/w1d5rXsGnxV03G5TqE2e1broZQ2vI6uR75dW6WRQFUUeYBRJ+JYNNtQXsqOeYwhMlOCXsR4l+wJH/b/TWd8JzOeE1KPBFSw21/vyY/k8vDIUN5kbvhwHNXgmWSJ5nvvADyWNm2rVDo7xnqH7LSPrzI1YtoGrPc7g7bppDSurLyGVpwHzQg37D/UX9XGNC8jvh8pgRCSrR5ExuIf15njbqElW68Jkb0ED3o0LzsOjJrO+c9gHacEOqMl6w75/qz/1RBme4XxyEp92vFifE5GiKX4yhLq7pBO8xPOP/FXcmptmdLGkZvnMCOUiWs0PMB8uo8wcpMxpn1pbvzRVLYLplTwm46IQqwAgohRaog0qBmKX1HSoVPVhTfvsUbZ3gMriXCWcn+qtQwMAzjSxg1XZkcUV25rxfEzPwjMhxTlNVD9qxm+KBbmZRxg2RZ3Q09hrh1JG9x//mle460EsHKFng8fusRcZahy+b0MUVQxYh5BabKDT0gDoIc3zGwH9/Ly6g4BD7etvzJinqGA9gpJjcPL99FpRvu27makRuGVTPn5tWi062QUkgWbg LpEDoZOd jA8DGEFRF/OLBpCiOp++marVOGXB/CYFtytqptw8p/iQ8Gv6Xva0+s34obm63xaok++TR4r0xwFfgZ56tpKBqr70xEsqdzDCeYXbNdzGdREduIoO2x6TjuIx4gE3C7m2ZjklvRff7URerx0nYOu7KsWTHJa1dUEbW+5JX 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: David Hildenbrand writes: > On 13.04.23 15:07, David Hildenbrand wrote: >> On 12.04.23 05:16, Stefan Roesch wrote: >>> This adds three new tests to the selftests for KSM. These tests use the >>> new prctl API's to enable and disable KSM. >>> >>> 1) add new prctl flags to prctl header file in tools dir >>> >>> This adds the new prctl flags to the include file prct.h in the >>> tools directory. This makes sure they are available for testing. >>> >>> 2) add KSM prctl merge test >>> >>> This adds the -t option to the ksm_tests program. The -t flag >>> allows to specify if it should use madvise or prctl ksm merging. >>> >>> 3) add KSM get merge type test >>> >>> This adds the -G flag to the ksm_tests program to query the KSM >>> status with prctl after KSM has been enabled with prctl. >>> >>> 4) add KSM fork test >>> >>> Add fork test to verify that the MMF_VM_MERGE_ANY flag is inherited >>> by the child process. >>> >>> 5) add two functions for debugging merge outcome >>> >>> This adds two functions to report the metrics in /proc/self/ksm_stat >>> and /sys/kernel/debug/mm/ksm. >>> >>> The debugging can be enabled with the following command line: >>> make -C tools/testing/selftests TARGETS="mm" --keep-going \ >>> EXTRA_CFLAGS=-DDEBUG=1 >> Would it make sense to instead have a "-D" (if still unused) runtime >> options to print this data? Dead code that's not compiled is a bit >> unfortunate as it can easily bit-rot. >> This patch essentially does two things >> 1) Add the option to run all tests/benchmarks with the PRCTL instead of >> MADVISE >> 2) Add some functional KSM tests for the new PRCTL (fork, enabling >> works, disabling works). >> The latter should rather go into ksm_functional_tests(). > > > "tools/testing/selftests/mm/ksm_functional_tests.c" is what I wanted to say. I understood. I'll look into moving the fork check and the disabling into the functional tests for the next version.