Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp767141pxy; Wed, 28 Apr 2021 13:52:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsVfQgpcpFTT70K7k0Zi6i+Ba1qJ5eckUnYHYTwp7uBqCQQCjZJDO9vH8As+z7zjgD5uoa X-Received: by 2002:aa7:da42:: with SMTP id w2mr13876136eds.58.1619643146321; Wed, 28 Apr 2021 13:52:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619643146; cv=none; d=google.com; s=arc-20160816; b=bjFKwKP4R3NmksAH9MeNOq+Gl0Hp9q8WjIwR1O29tfzx4pJBM+PYwOUGgiOtnGYuBk Kh6mOCNVhiEBqf53H/7n/2AHEpC1Tj4pAxJ1ns61q0ulamsDW5hOUyBEN1pTw/9I47O6 FkJ0MjEsgcn6LrGZR24hg99HNSwFli/3AOUMqn75i1BDQdhy/z1xIBTK0I0DR/DwNHGJ Pj00XtZvM4o0cZ9XqniPCMf+QHLllyinFiylRQoMAh9bH9f3wxfoKOLY6GQdBG9qO5DZ WQKIh2DmbImhrG3mQhXuJYlZ5vCMf40xaBu4HM/WLgpOHmSITaGMmut/0md8qAsxCHrt aABQ== 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=6QmxbNDcfkmoT4snx6gLW6zB0uLTOmzBgWbCGZ43h/M=; b=QmvOfyaH6T9jcuLacfoFqYFNxXmwNs5bB9vgAs6l10zqqTw7168m5UQtv+swciNBw+ j2eT54ZM7+OxR/SQqYt1dt18nCNn9ZWlpRNoJbpp4RdYTOI/iY06mzUqI4sFb0XRSN5H Kb1RVmhVIQ5rfnfvBBoLrcrliEdPlYQt6yPO5abrHHjkSX/dXtx6wENkH08jg4uo8sXY 3uc1FgZzfGFBzgiivpTQQA2gmVkEKcFQutilxoD4kyQi0NaBFp0iF+EK8FDV998zEQMt /1Hnb8A1P0CqSrg6cpC86lJi0Zcw5F6DUgsCqQMGJMXWCYTPLIaldZNl/D5+WFing7Zm P28Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZzCrrHdO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a20si777026edx.287.2021.04.28.13.52.02; Wed, 28 Apr 2021 13:52:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZzCrrHdO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231339AbhD1RYd (ORCPT + 99 others); Wed, 28 Apr 2021 13:24:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23414 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231844AbhD1RYc (ORCPT ); Wed, 28 Apr 2021 13:24:32 -0400 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-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-17-OpMk-K7jMoWnZ6P6slb7SQ-1; Wed, 28 Apr 2021 13:23:44 -0400 X-MC-Unique: OpMk-K7jMoWnZ6P6slb7SQ-1 Received: by mail-qv1-f70.google.com with SMTP id h88-20020a0c82610000b02901b70a2884e8so8828994qva.20 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=ALhgSBi1M5Rbu+sWlK1yRXEYSLGWt+iDMuGtAjE3JSP3AYfvRf86XmdyvQFXN9Yzxd n1yJpSFamqvYnGczAFm3WGM5bWJ5UsSvmPqxZylohu7LNwTw94XNyshRZx3vSmVAJ0+E aRLcnWyPVmvPW76cp3v1fO7JRivP0mVm4Z7ELxmApDNsAVTRND980dT/56Wbf/et8mIv aIlAE5DnPFR6AcNfvdNq0qbn4RhEUW+PH5fv1uSB+Mer1p3m5y9r5Lxm6Ex0GmN7P0p1 7CAz/m/WPdNgQIqZBHEmknI7YsFfwcgY/laXPLTCX3YdTU1Uq1FT1w1SLMVymThk5jub Dl1w== X-Gm-Message-State: AOAM533W9nv+jOwnZrIDDCKEDyR5seLWe8nCp+W+ACtTrli54H8tmfdS scgwfJqqILe+czKufUPMS8pIecrp4G8S4uhZhRU3naxTFLhFh/SvR8RnAk2r5TB9V20ycq39KBb wob2Bk0ExVDjan6D6VZ3oCO2Y X-Received: by 2002:ae9:f310:: with SMTP id p16mr29914959qkg.123.1619630624372; Wed, 28 Apr 2021 10:23:44 -0700 (PDT) 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 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210427225244.4326-10-axelrasmussen@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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