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=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=unavailable 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 78475C433ED for ; Tue, 18 May 2021 22:29:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5849660232 for ; Tue, 18 May 2021 22:29:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352751AbhERWaw (ORCPT ); Tue, 18 May 2021 18:30:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352741AbhERWat (ORCPT ); Tue, 18 May 2021 18:30:49 -0400 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 170BDC06175F for ; Tue, 18 May 2021 15:29:31 -0700 (PDT) Received: by mail-io1-xd30.google.com with SMTP id z24so11059820ioj.7 for ; Tue, 18 May 2021 15:29:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sJSTAKCZ+krTWG3lgInmgl4vdo4n0Oih7NdB8EZOroE=; b=jbuHe9+Qf8UciW37lf7ZswZs7ReoWXczX04sFI1v7v+3FEj4I+EoN+d69cBUfvxZL2 pppqzzmCpxde7Hh+QW7SdZ1jnX4IX5TcXLfsMzhVJOrTYHglNNe+YSCOyZrx8IZeqH1D IXg0zl7mwhjrFeuEQYeofug0VDMviAXFvR3ZUcYWSeo/1nefLar6o+c5Cb94aEOmOEE9 MQy8UMokWYa8Fi1ImWSqAGd0WJbpPO0JSFgRT6Jmr+Nw5hnSuXw/G4l0obG05YIbnKtn XjsnCgoHUZulXA1LHNcZ3wLelpQCj9ucW4gS+3QoYK/5Ibly+MvFuRT9L+37QjSIjH/f tnGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sJSTAKCZ+krTWG3lgInmgl4vdo4n0Oih7NdB8EZOroE=; b=o6/cB3E4Z6yaH6GWZfYW3DTFD+sFuUIVS/qRBYUG8GEuiHC9NjoYFXDASFjHW66LlV LnYZgi/3aiV3GmxehnkEx73FyKZSxisRuXzMKew57/CXFgRLLViiFk133hzbiOnoMPYs gkNCOTeTz/4WfbuPwS07erP9ZQulSMpwWJyGd840kIPrA1wOigtNPF0bEfywd+4fzXV/ eojRRe0rUBgK/6vDJE4UF/yHuBkVpTy+y0RQSwb0kVHb1oxG7mVToqa+muUfBUfSxScZ z/tRhO+LjgGbsZBYoYAxdpWthBtnyYqXPKxe+TbW2yof1fpRjaTBb1VhIG/FzGRPeSNP sP7A== X-Gm-Message-State: AOAM531inD5hDfA56swQHkD5WUM1MRXN8JVX/sQAQW/hieX9RTn3O6As 2cfJQR61BCXXeAE1Y2NKi1V8wHAB/58ZH6HCacOQhA== X-Google-Smtp-Source: ABdhPJxg1XeLxXOYntitmR4NlPBu0nqJwFp2PCXTohQRhknrcmZuOxJxUcxf72xJjinay2qMPf2wVkwu5qRUYJyu2as= X-Received: by 2002:a05:6602:446:: with SMTP id e6mr6560189iov.20.1621376969710; Tue, 18 May 2021 15:29:29 -0700 (PDT) MIME-Version: 1.0 References: <20210427225244.4326-1-axelrasmussen@google.com> <20210427225244.4326-10-axelrasmussen@google.com> In-Reply-To: From: Axel Rasmussen Date: Tue, 18 May 2021 15:28:52 -0700 Message-ID: Subject: Re: [PATCH v5 09/10] userfaultfd/selftests: reinitialize test context in each test To: Peter Xu Cc: Andrew Morton , Alexander Viro , Andrea Arcangeli , 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, LKML , linux-kselftest@vger.kernel.org, Linux MM , Brian Geffon , "Dr . David Alan Gilbert" , Mina Almasry , Oliver Upton Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I suppose it will be squashed anyway, but in case it's useful feel free to add: Reviewed-by: Axel Rasmussen Thanks for catching this, Peter! On Tue, May 18, 2021 at 1:57 PM Peter Xu wrote: > > 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 > > Hi, Andrew, > > There's a conflict on the uffd test case with v5.13-rc1-mmots-2021-05-13-17-23 > between this patch and the uffd pagemap series, so I think we may need to queue > another fixup patch (to be squashed into this patch of Axel's) which is > attached. > > Thanks, > > -- > Peter Xu 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=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL 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 DFDBBC43461 for ; Tue, 18 May 2021 22:29:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 57DA660232 for ; Tue, 18 May 2021 22:29:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57DA660232 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9A9458E0058; Tue, 18 May 2021 18:29:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9592D8E002F; Tue, 18 May 2021 18:29:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 80B988E0058; Tue, 18 May 2021 18:29:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0101.hostedemail.com [216.40.44.101]) by kanga.kvack.org (Postfix) with ESMTP id 528338E002F for ; Tue, 18 May 2021 18:29:31 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id D33DF181AF5D3 for ; Tue, 18 May 2021 22:29:30 +0000 (UTC) X-FDA: 78155794500.26.5D667E6 Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by imf19.hostedemail.com (Postfix) with ESMTP id AB90D90009E9 for ; Tue, 18 May 2021 22:29:30 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id t11so11022055iol.9 for ; Tue, 18 May 2021 15:29:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sJSTAKCZ+krTWG3lgInmgl4vdo4n0Oih7NdB8EZOroE=; b=jbuHe9+Qf8UciW37lf7ZswZs7ReoWXczX04sFI1v7v+3FEj4I+EoN+d69cBUfvxZL2 pppqzzmCpxde7Hh+QW7SdZ1jnX4IX5TcXLfsMzhVJOrTYHglNNe+YSCOyZrx8IZeqH1D IXg0zl7mwhjrFeuEQYeofug0VDMviAXFvR3ZUcYWSeo/1nefLar6o+c5Cb94aEOmOEE9 MQy8UMokWYa8Fi1ImWSqAGd0WJbpPO0JSFgRT6Jmr+Nw5hnSuXw/G4l0obG05YIbnKtn XjsnCgoHUZulXA1LHNcZ3wLelpQCj9ucW4gS+3QoYK/5Ibly+MvFuRT9L+37QjSIjH/f tnGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sJSTAKCZ+krTWG3lgInmgl4vdo4n0Oih7NdB8EZOroE=; b=QC0lXHECHKvdkOzKXITm8AH3UKWKUNci+KZ7pUlM6mrOyADqy6f06cSP4/TX9B+Tmu gaIN45tNF6yZ2UQcaL0/4VHz0JZ4dE2Y8EIO2dZBp+xMDzfkGsrRXQEyy/fAe5/7MqXg r5MhpBOY29qumc7JeN7dZWWKH8FHM0Xie6OSBqXamkol93gyWsfdS0BNhiQJVloMc8Ja j0VCbZpWTb7U4q3lssNmesUzK4npsYexYhDgkFOXjL+4Vx1gp1mRVPV3UPy40VQxmAyF IhS7kCodQzIpzLOgfTmlwNjhDPti3bxYvJivxGdJoOACRIFEFtIbQ9YzsiQffjm5E3b3 hGTw== X-Gm-Message-State: AOAM532hCOPybtB8lvF+APXK/KDI4jVomtef2cpRy+yj6R+E5Z2/xtXw 5uB9CXKOu+NRbq5ClV9F+7ULeR2GvwLNXZwykI4I8Q== X-Google-Smtp-Source: ABdhPJxg1XeLxXOYntitmR4NlPBu0nqJwFp2PCXTohQRhknrcmZuOxJxUcxf72xJjinay2qMPf2wVkwu5qRUYJyu2as= X-Received: by 2002:a05:6602:446:: with SMTP id e6mr6560189iov.20.1621376969710; Tue, 18 May 2021 15:29:29 -0700 (PDT) MIME-Version: 1.0 References: <20210427225244.4326-1-axelrasmussen@google.com> <20210427225244.4326-10-axelrasmussen@google.com> In-Reply-To: From: Axel Rasmussen Date: Tue, 18 May 2021 15:28:52 -0700 Message-ID: Subject: Re: [PATCH v5 09/10] userfaultfd/selftests: reinitialize test context in each test To: Peter Xu Cc: Andrew Morton , Alexander Viro , Andrea Arcangeli , 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, LKML , linux-kselftest@vger.kernel.org, Linux MM , Brian Geffon , "Dr . David Alan Gilbert" , Mina Almasry , Oliver Upton Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: AB90D90009E9 Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=jbuHe9+Q; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf19.hostedemail.com: domain of axelrasmussen@google.com designates 209.85.166.47 as permitted sender) smtp.mailfrom=axelrasmussen@google.com X-Rspamd-Server: rspam03 X-Stat-Signature: wyc3mjczd5h3sn7msnwxyeig71qszhri X-HE-Tag: 1621376970-169110 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: I suppose it will be squashed anyway, but in case it's useful feel free to add: Reviewed-by: Axel Rasmussen Thanks for catching this, Peter! On Tue, May 18, 2021 at 1:57 PM Peter Xu wrote: > > 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 > > Hi, Andrew, > > There's a conflict on the uffd test case with v5.13-rc1-mmots-2021-05-13-17-23 > between this patch and the uffd pagemap series, so I think we may need to queue > another fixup patch (to be squashed into this patch of Axel's) which is > attached. > > Thanks, > > -- > Peter Xu