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 88DCFC6FA89 for ; Fri, 9 Sep 2022 03:06:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EB9EF8D0003; Thu, 8 Sep 2022 23:06:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E6A138D0002; Thu, 8 Sep 2022 23:06:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D0A798D0003; Thu, 8 Sep 2022 23:06:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C22F18D0002 for ; Thu, 8 Sep 2022 23:06:08 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 82A501C5E5B for ; Fri, 9 Sep 2022 03:06:08 +0000 (UTC) X-FDA: 79891058016.04.08EBD4E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf21.hostedemail.com (Postfix) with ESMTP id A5D991C008A for ; Fri, 9 Sep 2022 03:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662692767; 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=IRURgtGX8X3gpTPCUapV5nkhXYJnWyoPcRU7PWh1IAs=; b=YzhX2FBYb9u/ExPmhXy4HVb385+D+3M7bbhT/jM9Jzhh/5YdVBhixZtMRJw+Y9JI4djWGN OBaRIVF0GZXCB38Wq3laHB0FNxenKivFaUVoeYMeThhse2PzfbMmctPHnri1oilK/LDOxw BYYCLYfKzwLd+ohTE6pHYqVoMaXiKH0= Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-562-42Y9XaENN_G278UTUXDVHw-1; Thu, 08 Sep 2022 23:06:05 -0400 X-MC-Unique: 42Y9XaENN_G278UTUXDVHw-1 Received: by mail-ot1-f70.google.com with SMTP id o24-20020a9d6d18000000b00639239e36b0so242316otp.13 for ; Thu, 08 Sep 2022 20:06:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=IRURgtGX8X3gpTPCUapV5nkhXYJnWyoPcRU7PWh1IAs=; b=ENsjvHrZZ3Q+mklZ5oyFE47GGIeR/14jPMVeRtHfZQAsoiOYrhSBAc1UzmSKPWqccT OJQhcDz1cEE19jrId/1lYnJEHphGky/BMOp8aT2CZzqb/l+mPPCiT8aA+zjey+aeT90o 5I5Bkxx3v79+OF1oaP+CWrEzJWhd+ulM4FMww/fGvho20N+0ea+OWEcAPIuzAzTIKwnw C1wx/5fReZlLmVDRchek/ygUE454Vt49LzdaqSzgA+qnZOxIY5jCSEa2k11F/NgjD53z R23RB9SGBv/O4tVBA+NXTNtYRKFFChlTnlZw6aolqdCwq3O1b4WDv5REhLrA3ybQdAro oWbg== X-Gm-Message-State: ACgBeo0R6v7FNdR+U9LKFSR1kYFl+Em2JTeEoeI3NLRlmfNlztBMyyS9 5bXyD+C7I51vrjzSLrSQdt1S/XWq5s4+V5FKt2aJse6JU8bGrmm35kHc+I5m/ceGI5i0nVBymH/ g3Ff08dA0aQg= X-Received: by 2002:a05:6870:5b84:b0:10c:d1fa:2f52 with SMTP id em4-20020a0568705b8400b0010cd1fa2f52mr3722559oab.92.1662692764982; Thu, 08 Sep 2022 20:06:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR7MQiTOsG/QP8z4+DXZZztMsLYD43y8DUCK2rtP6/D2kclafpQbqKTECgoOL2i3LP5yOo6VOw== X-Received: by 2002:a05:6870:5b84:b0:10c:d1fa:2f52 with SMTP id em4-20020a0568705b8400b0010cd1fa2f52mr3722553oab.92.1662692764777; Thu, 08 Sep 2022 20:06:04 -0700 (PDT) Received: from ?IPV6:2601:280:4401:4fe0::518a? ([2601:280:4401:4fe0::518a]) by smtp.gmail.com with ESMTPSA id 5-20020aca1105000000b00344cc0c4606sm157038oir.58.2022.09.08.20.06.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Sep 2022 20:06:04 -0700 (PDT) Message-ID: <01f64e01-580e-abca-2b86-aa586d987bf4@redhat.com> Date: Thu, 8 Sep 2022 23:06:02 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v6 1/2] selftests: vm: bring common functions to a new file To: Muhammad Usama Anjum , Andrew Morton , Shuah Khan Cc: kernel@collabora.com, krisman@collabora.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, Joel Savitz References: <20220420084036.4101604-1-usama.anjum@collabora.com> From: Nico Pache In-Reply-To: <20220420084036.4101604-1-usama.anjum@collabora.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662692768; a=rsa-sha256; cv=none; b=RuIX/aCWU0yGNo5e0x0l30pEXdmj/1y+2oL6Emb3XgeqUE6+nlByCzgjRRVIdvDbm/LXRK MRxQCBuwMykyHdI2ZIV29WstgmSI6ke6kSV5P7m2auuaYtRg48U51juX2IA4IJmnqqVQbA cBmZX8lQJhBOdCpLmpLdqoVb0eLeF9Y= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YzhX2FBY; spf=pass (imf21.hostedemail.com: domain of npache@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=npache@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=1662692768; 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=IRURgtGX8X3gpTPCUapV5nkhXYJnWyoPcRU7PWh1IAs=; b=z+f4rA3bzTtd5bHA7kD3ufpiH39XfXxrZaosKK4l+AOYM624FC0DUlGx0WHDhgwD11FYH6 06hQZ/L418wsF+A4vKEojLz5uqtxkP6IdfLAdAgCTCPdioWDS4sbiwvulSMhlRzoIV869V /uQRiyo4O2jSpZNGwVjfGWErsUaq0/k= X-Rspamd-Queue-Id: A5D991C008A Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YzhX2FBY; spf=pass (imf21.hostedemail.com: domain of npache@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=npache@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: q17fb86b745tem9c5i64ryb87ux6e9eu X-HE-Tag: 1662692767-399264 X-Bogosity: Ham, tests=bogofilter, spamicity=0.016694, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 4/20/22 04:40, Muhammad Usama Anjum wrote: > Bring common functions to a new file while keeping code as much same as > possible. These functions can be used in the new tests. This helps in > avoiding code duplication. This commit breaks a pattern in the way tests are run in the current scheme. Before this commit the only executable (or TEST_PROGS) that was executed was run_vmselftests.sh. Now both madv_populate and split_huge_page_test are being run as well. > > Signed-off-by: Muhammad Usama Anjum > --- > Changes in V6: > - Correct header files inclusion > > Changes in V5: > Keep moved code as same as possible > - Updated macros names > - Removed macro used to show bit number of dirty bit, added a comment > instead > - Corrected indentation > --- > tools/testing/selftests/vm/Makefile | 7 +- > tools/testing/selftests/vm/madv_populate.c | 34 +----- > .../selftests/vm/split_huge_page_test.c | 79 +------------ > tools/testing/selftests/vm/vm_util.c | 108 ++++++++++++++++++ > tools/testing/selftests/vm/vm_util.h | 9 ++ > 5 files changed, 124 insertions(+), 113 deletions(-) > create mode 100644 tools/testing/selftests/vm/vm_util.c > create mode 100644 tools/testing/selftests/vm/vm_util.h > > diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile > index 5e43f072f5b76..4e68edb26d6b6 100644 > --- a/tools/testing/selftests/vm/Makefile > +++ b/tools/testing/selftests/vm/Makefile > @@ -34,7 +34,7 @@ TEST_GEN_FILES += hugepage-mremap > TEST_GEN_FILES += hugepage-shm > TEST_GEN_FILES += hugepage-vmemmap > TEST_GEN_FILES += khugepaged > -TEST_GEN_FILES += madv_populate > +TEST_GEN_PROGS = madv_populate madv_populate is already being run in run_vmselftests.sh > TEST_GEN_FILES += map_fixed_noreplace > TEST_GEN_FILES += map_hugetlb > TEST_GEN_FILES += map_populate > @@ -47,7 +47,7 @@ TEST_GEN_FILES += on-fault-limit > TEST_GEN_FILES += thuge-gen > TEST_GEN_FILES += transhuge-stress > TEST_GEN_FILES += userfaultfd > -TEST_GEN_FILES += split_huge_page_test > +TEST_GEN_PROGS += split_huge_page_test > TEST_GEN_FILES += ksm_tests > > ifeq ($(MACHINE),x86_64) > @@ -91,6 +91,9 @@ TEST_FILES := test_vmalloc.sh > KSFT_KHDR_INSTALL := 1 > include ../lib.mk > > +$(OUTPUT)/madv_populate: vm_util.c > +$(OUTPUT)/split_huge_page_test: vm_util.c Not sure what this does but if we add a run entry for split_huge_page_test in run_vmselftests.sh we wont really need this patch. I'm not sure the reduction in code size is worth the change in run behavior. Unless I'm missing something I suggest we revert this patch and add a run entry for split_huge_page_test in run_vmselftests.sh. I can do this if no one objects. Cheers, -- Nico