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 3160AC4167B for ; Wed, 29 Nov 2023 10:10:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 94FBB6B03BB; Wed, 29 Nov 2023 05:10:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8FF9B6B03BC; Wed, 29 Nov 2023 05:10:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7EF406B03BF; Wed, 29 Nov 2023 05:10:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 6E92B6B03BB for ; Wed, 29 Nov 2023 05:10:17 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 3DDFCC0316 for ; Wed, 29 Nov 2023 10:10:17 +0000 (UTC) X-FDA: 81510571674.04.15F663B Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf17.hostedemail.com (Postfix) with ESMTP id 9E7624000E for ; Wed, 29 Nov 2023 10:10:14 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of pvorel@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=pvorel@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701252615; a=rsa-sha256; cv=none; b=V7vOrNuzIRj1iJcfuCNUqEUG/KE2EL5vyJIZgjDM21dhPf+PmtusZPnGhWR9BmpLTZZT2M 76PzlrNkJLXjLcJ9T8ufW2/R9aFlqa2/jHwtgnfk7AUxJrIuHl+kqNWp1H4TEuhPIGWvAz E07G9xTKcRWaD+rkjKJXxIrVmCt/bbM= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of pvorel@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=pvorel@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701252615; h=from:from:sender:reply-to: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=vIH9O+2YLlpgRWGzLYbjiaJGlnHA5FSFNQjRhbulBW8=; b=ZIYu3tN2iUtunjGbmBFFrZzVnpJpoJAnZn8NSoEsd9OZTfR7l1iZKIt0dMDG6XddX+j7Xy Yn7F9q5Q+/YAqS9Cw0fRkE5FahxNo64XfbdDU+D60gSELHIcKayLOLxs5ZG3GFD2Zlqp8k Y7zxVH0X8Xcx5uhpt1RdTw4/ThPEbOY= Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id AC045219AE; Wed, 29 Nov 2023 10:10:12 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 40DA61377E; Wed, 29 Nov 2023 10:10:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id FpMwDQQOZ2V2XQAAn2gu4w (envelope-from ); Wed, 29 Nov 2023 10:10:12 +0000 Date: Wed, 29 Nov 2023 11:10:10 +0100 From: Petr Vorel To: Li Wang Cc: Stefan Roesch , kernel-team@fb.com, linux-mm@kvack.org, david@redhat.com, oliver.sang@intel.com, ltp@lists.linux.it Subject: Re: [LTP] [PATCH v1] mem: disable KSM smart scan for ksm tests Message-ID: <20231129101010.GA535399@pevik> Reply-To: Petr Vorel References: <20231127174517.2369593-1-shr@devkernel.io> <20231128074626.GA298624@pevik> <20231128165132.GA406520@pevik> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 9E7624000E X-Stat-Signature: r5y6gy5mjaboi7rckbu3ric4e3sfa76r X-HE-Tag: 1701252614-390708 X-HE-Meta: U2FsdGVkX1+UBCixWS1emKF6ovWbqdex9LNlHc/ZiB+fUtmyZrxGQACI79P4djbFX8odQaExWQz27jtklbAts6xTAXiuOnJugu5UeBKY63E5ZH3r9K5RX2q8nLNKJecSzGruw5ZgtGRKCmvZVGY0PpAZ1TsiDWMsIMV576sa6Z6oSmMKlRdAleGRIurCaXy9k0IeiBUQpK1HegPA+1cVm6xGNKYhBfJ6P/xquGZX/VMfGUqjC0zvxy6UkZdysWPOimHAsl5+wb1LrLQGSC/sQmCx9e8yiUUpUJYTysId1Ik5Pkf91Qs0EJl1nKsY3fp2e6/aoUdDpRWm2pFsGFgJsiS9i0O+rVtEpwGJRNuRAXIzXJE9Ik/NDCWbDnfOSFvVFIGp1+bSmQCHdn1GWfJ9u0VZJljx/mwCa7w67j4wizIDmMNOCjj6eK4Ch6E+02WmDq2DmazAXvXZz99WjR9d9RX2XFUaDTcHQGAFZISLgEuYIechDm0W/iKF7OYsgGevlJeS/h1LtSHWFE7tffmzBv0Y1/9HxHmBFOvf0l0wbtAhbIyVg9huYqfDaN17ITvU6RC8/Q/WhlyNzXUucStskfUoWGtFhwwrGh5ikhuFt0bZbhB29X8rUopelOFAi8vuTQIonrHVPWcg8yVofP0F4LQv/ON6U/0VbgvMp/biPW5/XVPjSb3szxp46VQowLGb0rG5O2Y2+3YhV9tffnhfKxJbCll4WdAOoEpS3f7gBTCgTiqEyNs5i1qjDJMAnhFNPSuTPY0lPPOzFCNMpeSRi/D+TjfCxEBCLuow1L8kcZ3NeS2x5MQfn7fpu3lEoAV7sptBm03OmSdiOPB0+ybhPdk5dqQ2TCCVcdBvLcOqmxk709a/Avo2u8/oN4fpakINAMUdbvfd1u3dB+pORROPU18ZBDKDSUJ76HtA8topCT4gsonA+S9vAsC+d96a+jeBERGgLcbaS9RW+NDTR8M WRAc2Ihs 1WNYeoM8IUwBDlQwn6q9xKCRNMa7IeIEEI+0YuFJBd3IqNd+kaE1nt7EGhy3HT7y2jX/5LGDVo2vEU05XXvf8Qqi233gTvk1lN/MBv50+d1GgV0fC1pIAEFB4dDH7m4sEIPiF8eeH6DXEZ90rF6EygSo79ALF4xTBWZ3Vbzmx+q7bI75Ane2HORcAfL3STs7UWMTeKD7UUIHde5QQYGb2bHX0DgZIDI0wllgiusUlGIgwX5y+qyKiff/5Gn7ext0dXZvK6dYd+UKS8SUOPmdsLfJryaRqLuqFK4n+mXSopbXXxIh1ieoukEm+Cg== 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: List-Subscribe: List-Unsubscribe: > On Wed, Nov 29, 2023 at 12:51 AM Petr Vorel wrote: > > Hi Stefan, Li, > > > Hi Stefan, Petr, > > > On Tue, Nov 28, 2023 at 3:46 PM Petr Vorel wrote: > > > > Hi Stefan, > > > > > This disables the "smart scan" KSM feature to make sure that the > > volatile > > > > > count remains at 0. > > > > > Signed-off-by: Stefan Roesch > > > > nit: you forgot 'shr@' > > > > Signed-off-by: Stefan Roesch > > > > > Reported-by: kernel test robot > > > > > Closes: > > https://lore.kernel.org/oe-lkp/202311161132.13d8ce5a-oliver.sang@intel.com > > > > > --- > > > > > testcases/kernel/mem/lib/mem.c | 4 ++++ > > > > > 1 file changed, 4 insertions(+) > > > > > diff --git a/testcases/kernel/mem/lib/mem.c > > > > b/testcases/kernel/mem/lib/mem.c > > > > > index fbfeef026..ef274a3ac 100644 > > > > > --- a/testcases/kernel/mem/lib/mem.c > > > > > +++ b/testcases/kernel/mem/lib/mem.c > > > > > @@ -454,6 +454,9 @@ void create_same_memory(int size, int num, int > > unit) > > > > > {'a', size*MB}, {'a', size*MB}, {'d', size*MB}, {'d', > > > > size*MB}, > > > > > }; > > > > > + /* Disable smart scan for correct volatile counts. */ > > > > > + SAFE_FILE_PRINTF(PATH_KSM "smart_scan", "0"); > > > > NOTE, this fails on the systems without /sys/kernel/mm/ksm/smart_scan: > > > > mem.c:458: TBROK: Failed to open FILE '/sys/kernel/mm/ksm/smart_scan' > > for > > > > writing: EACCES (13) > > > > NOTE, we normally handle the setup like this in test setup function. > > > > But new API has .save_restore which is more robust for tasks like > > this. > > > > It's already used in ksm01.c, you need just to add this line: > > > > {"/sys/kernel/mm/ksm/smart_scan", "0", TST_SR_SKIP}, > > > I guess we need to set 'TST_SR_SKIP_MISSING | TST_SR_TBROK_RO' > > > as the last field. Because TST_SR_SKIP will continue the test without > > > writing '0' to the smart_scan file, that's not correct if the file > > exists. > > > It will > > > ignore a kernel bug (smart_scan can't be written) by that config. > > > Per the Doc Petr pointed below: > > > TST_SR_SKIP_MISSING – Continue without saving the file if it does not > > > exist > > > TST_SR_TBROK_RO – End test with TBROK if the file is read-only > > > TST_SR_SKIP_RO – Continue without saving the file if it is read-only > > > TST_SR_SKIP – Equivalent to 'TST_SR_SKIP_MISSING | TST_SR_SKIP_RO' > > > > (instead of both SAFE_FILE_PRINTF) > > > > See: > > https://github.com/linux-test-project/ltp/wiki/C-Test-API#127-saving--restoring-procsys-values > > > > I wonder if ksm01.c is the only ksm test which needs to disable this. > > > I think all of the ksm0*.c tests should disable it by the config. The > > > smart_scan > > > will impact all the tests with invoke key function create_same_memory(). > > ksm05.c and ksm06.c does not use create_same_memory(). Or did I overlook > > something? > Good catch, I looked into these tests, seems only ksm05 is debatable > for disabling smart_scan, as a simple regression, it suggests disabling > ksm daemon to avoid disturb according to some workload. > https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/mem/ksm/ksm05.c#L30 > ksm06 is definitely need disable smart_scan, it tests KSM in different > 'run' state for merge_accros_nodes. Thanks for having a look. > To be on the safe side, I would suggest applying the patch to all ksm* > tests, > and write a new single for smart_scan if needed. Agree. I vote for new single for smart_scan related test. Kind regards, Petr