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 052DFC77B6E for ; Thu, 13 Apr 2023 13:08:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 507C3900005; Thu, 13 Apr 2023 09:08:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4B8A4900002; Thu, 13 Apr 2023 09:08:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 38183900005; Thu, 13 Apr 2023 09:08:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 24597900002 for ; Thu, 13 Apr 2023 09:08:28 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id E195B140134 for ; Thu, 13 Apr 2023 13:08:27 +0000 (UTC) X-FDA: 80676396654.18.4AF4049 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 1702680029 for ; Thu, 13 Apr 2023 13:08:23 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LCuwI5El; spf=pass (imf02.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681391304; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=nLxMOFwtCTuKusCwzTh/CCer82vVpWIO4TFSOoP+UhY=; b=DTH0JIS9ng2xqLqdaOt2guvvd2YUKNnZeodjqM+44ZTUeFfMOW/3lmGj1WPY8vJE3hUyes 8mRDKJtE03FfxWjj+6IjM02L3wd3LrP4v1vnXk8vfrQp+3k0TQ4axGGG/crgSeoOzFaEzx HqmHIsr+0DyX5n8FxIhNDKUIav4DJok= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LCuwI5El; spf=pass (imf02.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681391304; a=rsa-sha256; cv=none; b=OLRDnrXvjAlvf54eS1hK+fLwx4HMSkWzUDW9qbGSesE/DUu/+q/rCowGVLvUb+7a6gD/hM nmohUwhHHxcVEC83I1sVEnvPeIbaHL/0GciTXcsTGSoGO0cWqQ2p68DIfok3nxFZEVjuvY /i4K3PTWHTKCtrXGpbVqO4RSKgy1jrw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681391303; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nLxMOFwtCTuKusCwzTh/CCer82vVpWIO4TFSOoP+UhY=; b=LCuwI5Elr6lGFE2gLd0e9ueWLz84t8c7HMC5/3KEsSZGusfiIW0S3dNu9vuubqc2sgcIb1 wpfA+bz0U9j4eJtG8RLN5Ioz8mgS60ro8CNHSBmrGBhvKlYjGK8Cv4lvsXhk/qw/uKqNEh OsDNeLO/KjB1ei+49EmwcioJFfR+now= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-79-yuoU7e2bOVCqk9JfxmPXUw-1; Thu, 13 Apr 2023 09:08:22 -0400 X-MC-Unique: yuoU7e2bOVCqk9JfxmPXUw-1 Received: by mail-wm1-f71.google.com with SMTP id l20-20020a05600c4f1400b003f0a04fe9b9so2128379wmq.7 for ; Thu, 13 Apr 2023 06:08:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681391301; x=1683983301; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nLxMOFwtCTuKusCwzTh/CCer82vVpWIO4TFSOoP+UhY=; b=WvQYDCP/vVIapkKNcqG2CUq9ORsnNDlzJEOZGWhI/jiV+8dRAdkwp2FI8FW7yYYVCD euCMSv14gtxvO3teucZdMtb7egP63EzCrx6PbRqr+NB2iS37jZbAeYfT/TV7PJDSgIU9 wxFVt6LHrdd+R1vUsrP2Py0J1lUNEPVQ0NryeHKMfAc99E861Rap3LosPjcAkVA+gohc XROpIKrAnCOQ6qzpFApYfr7nGuQBJAphjoXq+MINmy2yuOKDDJ2D5Q+YTdwDNfnlEftJ Rp3krWsYwnjstNeONRESjf6PHCxzcv84mLH9zXpIXxaa0BzWfNkt+3RDT4FxMbLl11uI +zOg== X-Gm-Message-State: AAQBX9ccO9Dl/ApkTQtFtCYQ+oUtkPH8dV10ifZP4N5FANmPw1HA02il WlS+HyUNv5nRagZV7fOVGbSFVOlK9Gw2D8LkH86F2THaaWfRW5vVuWp3JDwfuFrhEiUOXYYL2rQ PHCcOvWlXCXg= X-Received: by 2002:a05:600c:2051:b0:3ed:8780:f27b with SMTP id p17-20020a05600c205100b003ed8780f27bmr1888723wmg.16.1681391301107; Thu, 13 Apr 2023 06:08:21 -0700 (PDT) X-Google-Smtp-Source: AKy350Y55JsVfSG6cqI5hM+rvCoSFl0/EwbLG1ziWZ2V3jk+27V2WCnOKEnjqr3iEAcf0fE0IxV6mQ== X-Received: by 2002:a05:600c:2051:b0:3ed:8780:f27b with SMTP id p17-20020a05600c205100b003ed8780f27bmr1888702wmg.16.1681391300734; Thu, 13 Apr 2023 06:08:20 -0700 (PDT) Received: from ?IPV6:2a09:80c0:192:0:5dac:bf3d:c41:c3e7? ([2a09:80c0:192:0:5dac:bf3d:c41:c3e7]) by smtp.gmail.com with ESMTPSA id hn25-20020a05600ca39900b003f0a9e986ddsm1282283wmb.24.2023.04.13.06.08.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Apr 2023 06:08:20 -0700 (PDT) Message-ID: <190bed16-7b7b-a880-9793-cdeb1baef29d@redhat.com> Date: Thu, 13 Apr 2023 15:08:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH v6 3/3] selftests/mm: add new selftests for KSM From: David Hildenbrand To: Stefan Roesch , kernel-team@fb.com Cc: 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 References: <20230412031648.2206875-1-shr@devkernel.io> <20230412031648.2206875-4-shr@devkernel.io> <7c5606cc-ca58-c505-b0d3-2eec29fe606a@redhat.com> Organization: Red Hat In-Reply-To: <7c5606cc-ca58-c505-b0d3-2eec29fe606a@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 1702680029 X-Stat-Signature: eg8ue1psmkech8okoi3xtn9oy8aw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ma5cw3/0q8XTWFbQ6ihvcU/kEToX+hUZk+sGw5yC70+362WZxXDDlKIyoAfhc/uF5gXEM4hoPoaFKPYSOnyhRmPKl+YIva7CkisY5OmiQp7nU6jSNuY4UVI4G/8WHVNSNgjEVL/3wWPOfEGsFI519xFdKPF8Mty9lJKHnc51nuC1wOHacWca6vi1MMY9DYEkJvGseRLKlbbl8zMd98/nxQA6CxK3SBEuyR8AT8tx3sabR1TWl6RSb1lrYMQFwGfks8F4ndoef2E1GliGq8QvEGbEgBhG361WO8gAbPcHjjHDHa18jbwqC4gDDOSKkD/a01xxFXG9kSaSz7hZAAuPWKHpoiVh+j5LQP0XT6nu2mMOjsUV5K8BqE= 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 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. -- Thanks, David / dhildenb