Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2843842rwd; Fri, 2 Jun 2023 15:58:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4RDIz0tD2cYwthSvtTA3mc6V54Jn71tehJUM+1zAzRq1wHA0F+u8pRj3189beWy5Z5XfQm X-Received: by 2002:a0d:d8d7:0:b0:568:d9a5:b361 with SMTP id a206-20020a0dd8d7000000b00568d9a5b361mr1484722ywe.16.1685746720097; Fri, 02 Jun 2023 15:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685746720; cv=none; d=google.com; s=arc-20160816; b=AEyEV9IuBEMzwOEZ5yO2g/IhP3mSDidVa+QnkggZ4ZcrPB5TA9OHX8vWgukIuGF62w fbnH53VEindK417HmRiWkBw6I6jQsvlEdlf7W7liHZwWjI2o9dw3wGIbKHSOrnfFLqEF znPW/BeA51XpCxTSgi805EGHJXecD5M4MxoQ2F2YwQHcsgtJMXpoGH7bMQBJa4IdCQ4/ D0dGtCDYlpRuDRABlTYs7Uxciii6gyywNyCAV5zB23kzMJzu/R5Ca+IF4saeqF0zz2FR BogpfAMfjO7Pt6fsxT8yNx0XXAZi4yeR9A5C/QGrS5A/0GDMS95Ya0hbZkwJHoVSKWIV vMfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oR1X1ew3x0HcJtcEhJmoN8Cw49Yjt6Fdc1YyTgyzmkA=; b=uK4UASkJLkqD4ycOmmcM5ffg+YtZdPILXlWluJmMk5x1Srd0IbuYyLKvedws3j0xVR FhtSdpEUlqOogiQDSF8TeP0Tc9TRLWaRFqkdD79Q0W83KhEs9lDLzCahyNCOApYBUrH3 +oF53TCv+pwD7Bf2sUqzOr2KoMM6yi+YOmFsrlufAOlTf+GomqkP6eYvgKn8744SD1F0 5hqPjjzmgs6kZsFY1CQoLg2Nvv00kFKEpdee/qNg73nWEWMhzaDbpHsiaxWIcpBKHn9H VlttvQy+qL8g5m4D+pWU4e7AHkodgyitVT29Tpsl3GevXi73nn80hDJ8XVP3Xb1HCBIq SpWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NSF7Qyc9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a5-20020aa795a5000000b0063d5f645cacsi1421575pfk.116.2023.06.02.15.58.28; Fri, 02 Jun 2023 15:58:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NSF7Qyc9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236128AbjFBWjV (ORCPT + 99 others); Fri, 2 Jun 2023 18:39:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234960AbjFBWjU (ORCPT ); Fri, 2 Jun 2023 18:39:20 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41DC21BC for ; Fri, 2 Jun 2023 15:38:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685745513; 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: in-reply-to:in-reply-to:references:references; bh=oR1X1ew3x0HcJtcEhJmoN8Cw49Yjt6Fdc1YyTgyzmkA=; b=NSF7Qyc9yDQIMQ6Ek+N7TBhFAs0uL3fOA3sbAMzywiJHJ1UF8YSpA3emQpS2hPBg7qxaVK Hj0pJWz1xRZ6bdHTzq0xRuG24fF7kuFJp4VuJaME6v4UZXJ3pjYUymllRws6IGkqVTRtGE V2THc03NyRxi7wsAJovjaH1YL7cGY9s= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-556-Kw4ngPf0Me-1N-0LU2gQAw-1; Fri, 02 Jun 2023 18:38:32 -0400 X-MC-Unique: Kw4ngPf0Me-1N-0LU2gQAw-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-62632620f00so2998476d6.0 for ; Fri, 02 Jun 2023 15:38:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685745511; x=1688337511; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oR1X1ew3x0HcJtcEhJmoN8Cw49Yjt6Fdc1YyTgyzmkA=; b=A3rSisifhqa1mmBKkJLiyV8fR8pdn6ZL/PNv8r0EBJiDSqQ2UGU2fO7IgtgAk64ubR D40S2HVvUW0SIrO/LS5N/dHrlD7ReV+crOilSv3xVOOgxvPexqw8sEReS+cbyAAqL/Iz PxTJ/GG7MV9W6o7/leX7Nfntl/jJPIkDGjPY2yNFBaJ5/LOeDdS583v6ZvZl85xAvp8r 4zYVtgwTj0dTJTyRkoaa0e42xF/adjuCaWhu5j9cmw6gwlpPGgEDTry0VC/nOgC/4Lul bEWIuhwCta2f0XwkZLNuR3V9n/dP80gSGfR544PRSTl1zLm6xsD1uagPYIjFNrmhQdTm 47mA== X-Gm-Message-State: AC+VfDyENXmD5ItklpsKjo5yxCP4VySJyim0m9xPIt40knAPRgGjnqLM 9xo/SvMBXWSurVgr3quCL2DBU49Y03mioDCv9r+oKcWtHZ5fRc7QqqUi9+/QJ3BqvUK4fl8gZU4 DMb0Spq8YSm3/h5RVThPdzpoTC7MX5Mc8 X-Received: by 2002:a05:6214:27c9:b0:624:dcc5:819f with SMTP id ge9-20020a05621427c900b00624dcc5819fmr15407064qvb.1.1685745511421; Fri, 02 Jun 2023 15:38:31 -0700 (PDT) X-Received: by 2002:a05:6214:27c9:b0:624:dcc5:819f with SMTP id ge9-20020a05621427c900b00624dcc5819fmr15407047qvb.1.1685745511171; Fri, 02 Jun 2023 15:38:31 -0700 (PDT) Received: from x1n (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id f19-20020ac84713000000b003f543cbb698sm1317948qtp.23.2023.06.02.15.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 15:38:30 -0700 (PDT) Date: Fri, 2 Jun 2023 18:38:29 -0400 From: Peter Xu To: John Hubbard Cc: Andrew Morton , David Hildenbrand , Shuah Khan , Nathan Chancellor , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, LKML Subject: Re: [PATCH 10/12] selftests/mm: move uffd* routines from vm_util.c to uffd-common.c Message-ID: References: <20230602013358.900637-1-jhubbard@nvidia.com> <20230602013358.900637-11-jhubbard@nvidia.com> <68549f29-fe41-04d4-f648-245f399c350b@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <68549f29-fe41-04d4-f648-245f399c350b@nvidia.com> X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 02, 2023 at 03:11:52PM -0700, John Hubbard wrote: > On 6/2/23 08:59, Peter Xu wrote: > > On Thu, Jun 01, 2023 at 06:33:56PM -0700, John Hubbard wrote: > > > This is where they belong, and this makes it cleaner to apply a > > > follow-up fix to the uffd builds. > > > > > > Signed-off-by: John Hubbard > > > > Thanks for further looking into this. > > > > I'm fine to move it over if you think proper, but just to mention I had > > those in vm_utils.h just because I left all uffd specific tests shared code > > in uffd-common.h, so my plan was uffd-common.h shouldn't be included in > > most test cases except uffd tests. > > I think we're in agreement that we want to only include uffd-common.h > where it's actually required. Likewise with the uffd*() routines. So I > would like to still move this over, yes, just to have things in their > best-named location. Sorry I didn't get it - e.g. I'm confused why we need to export uffd_test_ops into ksm unit test, it doesn't make much sense to me.. If you think vm_util.h is a name too common to contain uffd helpers, shall we create another vm_util_uffd.h just to put the uffd helpers? Just see what's there in uffd-common.h, which is still ugly (I could look into it some other day): extern unsigned long nr_cpus, nr_pages, nr_pages_per_cpu, page_size; extern char *area_src, *area_src_alias, *area_dst, *area_dst_alias, *area_remap; extern int uffd, uffd_flags, finished, *pipefd, test_type; extern bool map_shared; extern bool test_uffdio_wp; extern unsigned long long *count_verify; extern volatile bool test_uffdio_copy_eexist; extern uffd_test_ops_t anon_uffd_test_ops; extern uffd_test_ops_t shmem_uffd_test_ops; extern uffd_test_ops_t hugetlb_uffd_test_ops; extern uffd_test_ops_t *uffd_test_ops; and more. That's why I think this header should not better be included by anyone else besides uffd-stress.c and uffd-unit-tests.c for now. > > > > > I'm not sure whether we can just make your next patch of "ifndef.." into > > vm_utils.h to avoid the movement, or is it a must? > > > > Actually, I think I can drop the next patch entirely, based on > Muhammad's observation that we should be doing a "make headers" > to pull in those items. I'll have more to say over on that thread. Sure, great if the local headers will work. Thanks. -- Peter Xu