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 X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FD8FC433B4 for ; Wed, 28 Apr 2021 17:23:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 80DC5613D8 for ; Wed, 28 Apr 2021 17:23:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 80DC5613D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D672A6B006E; Wed, 28 Apr 2021 13:23:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D04306B0078; Wed, 28 Apr 2021 13:23:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B56066B0096; Wed, 28 Apr 2021 13:23:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0058.hostedemail.com [216.40.44.58]) by kanga.kvack.org (Postfix) with ESMTP id 948026B006E for ; Wed, 28 Apr 2021 13:23:47 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 4E87E5841 for ; Wed, 28 Apr 2021 17:23:47 +0000 (UTC) X-FDA: 78082448094.11.608AD6F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf20.hostedemail.com (Postfix) with ESMTP id 3A18ED6 for ; Wed, 28 Apr 2021 17:23:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619630626; 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=6QmxbNDcfkmoT4snx6gLW6zB0uLTOmzBgWbCGZ43h/M=; b=ZzCrrHdOP4mJDOUxSO+4Q35NSCs/UVzEYL0+E6A4nwVXZlJ3jlcbDT7BXrCRtifO+UwYBe oUzyQIbHta8wd7OyV16gwsMtsOREU/xhaIFfPvaCeQHes5mm/mb0i8gCVQ0rHTXmzV/i8l I7VqYah1c3/+dw0KoR+yIYo+LJG8uTU= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-150-Yx7fgDSWMVKG3cbFXWWrBA-1; Wed, 28 Apr 2021 13:23:44 -0400 X-MC-Unique: Yx7fgDSWMVKG3cbFXWWrBA-1 Received: by mail-qv1-f71.google.com with SMTP id o6-20020a0ccb060000b02901c0933b76e1so1543254qvk.8 for ; Wed, 28 Apr 2021 10:23:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6QmxbNDcfkmoT4snx6gLW6zB0uLTOmzBgWbCGZ43h/M=; b=nbSSBc9DL+Ap3GtlpentDC5ehTk1u0lpkNfi765syHFhmsyOyX7/S8lBG5xp8BjvWN DYVMblZ3vtpkFhe0CdbDCqL8T7DzK6YUCBwBOB/Di+prHvJQPLwJFV9uTEHh4ea4MQ5S wezefDNOx3R5T4kW5QaVCiYr7EXFxRb4vXFH8gXaWoZVzGb55WYSt1L+pNZUJa7lteV2 3O7srFNdqBl6g5TBL6rFp2/V7s4wOJctv3NM0OMn84SpCWpafN0nnDM7Pv5GreuQEcbo LTAcmXWlxIXdOlSN2AvBGi2bOG1+vqrr1OKZ+R35e7jV1PnjHc60LQ0MhU634OuL/c3Y 7B6w== X-Gm-Message-State: AOAM533ktTVbJfn8Npi0xpd9pJh5uwhnoEKx1FW5q4jaatPALhrHbf+v h/7/FX0lWm2BUBpl3Sr4/NdlP/OF7nd3Vd/3H8qqEMWETkt3tn4lFbPzW34SnVGfDOc9O1pD42d qqcA0x+MygEo= X-Received: by 2002:ae9:f310:: with SMTP id p16mr29914956qkg.123.1619630624371; Wed, 28 Apr 2021 10:23:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweTpfhxOs2+FE7b/y38FVRdocxBBDoCy0Saro4x4l/ivnG64cNuM5i6194baTUbY8T8h2pWw== X-Received: by 2002:ae9:f310:: with SMTP id p16mr29914911qkg.123.1619630624022; Wed, 28 Apr 2021 10:23:44 -0700 (PDT) Received: from xz-x1 (bras-base-toroon474qw-grc-77-184-145-104-227.dsl.bell.ca. [184.145.104.227]) by smtp.gmail.com with ESMTPSA id 198sm275365qkf.20.2021.04.28.10.23.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 10:23:43 -0700 (PDT) Date: Wed, 28 Apr 2021 13:23:41 -0400 From: Peter Xu To: Axel Rasmussen Cc: Alexander Viro , Andrea Arcangeli , Andrew Morton , Hugh Dickins , Jerome Glisse , Joe Perches , Lokesh Gidra , Mike Kravetz , Mike Rapoport , Shaohua Li , Shuah Khan , Stephen Rothwell , Wang Qing , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, Brian Geffon , "Dr . David Alan Gilbert" , Mina Almasry , Oliver Upton Subject: Re: [PATCH v5 09/10] userfaultfd/selftests: reinitialize test context in each test Message-ID: <20210428172341.GF6584@xz-x1> References: <20210427225244.4326-1-axelrasmussen@google.com> <20210427225244.4326-10-axelrasmussen@google.com> MIME-Version: 1.0 In-Reply-To: <20210427225244.4326-10-axelrasmussen@google.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 3A18ED6 X-Stat-Signature: bqjzriqqm5kahmicebmgzn8dnko13jwf Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf20; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=170.10.133.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1619630618-356684 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 Tue, Apr 27, 2021 at 03:52:43PM -0700, Axel Rasmussen wrote: > Currently, the context (fds, mmap-ed areas, etc.) are global. Each test > mutates this state in some way, in some cases really "clobbering it" > (e.g., the events test mremap-ing area_dst over the top of area_src, or > the minor faults tests overwriting the count_verify values in the test > areas). We run the tests in a particular order, each test is careful to > make the right assumptions about its starting state, etc. > > But, this is fragile. It's better for a test's success or failure to not > depend on what some other prior test case did to the global state. > > To that end, clear and reinitialize the test context at the start of > each test case, so whatever prior test cases did doesn't affect future > tests. > > This is particularly relevant to this series because the events test's > mremap of area_dst screws up assumptions the minor fault test was > relying on. This wasn't a problem for hugetlb, as we don't mremap in > that case. > > Signed-off-by: Axel Rasmussen Reviewed-by: Peter Xu -- Peter Xu