Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp1071969pxb; Fri, 13 Aug 2021 12:49:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhugAgSlMmqjybCISE9lC7wKc1W+/V/I2peR6fMNObuPYIjOKmUjfoMyQoQOCbXzLCBaWz X-Received: by 2002:a17:906:c087:: with SMTP id f7mr3993004ejz.487.1628884169576; Fri, 13 Aug 2021 12:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628884169; cv=none; d=google.com; s=arc-20160816; b=CxVzVkB7llxsTcc1SsD/EuoTXB0x1kujota45hG8bFfrcRi7iLF4KsM5x3bQmqNaPM 7CR1rJGG016QQ0sqv0R00siHSPGZxtCN8B+xJaFsDb4KDrzerW0eM+gQeR7qqFw+c/fm cXHCx5X742DrSiSAA9xNF407J9AKEv4kUAErCVimDXW7YFgKpDvy4kIEd494zsmEUCnA RsgTqNovJhUGyfDqsJPiHIrRbMv0trxHrZPD39mgzh1HHa/a9SYT/uqaoA3gGyYhoZ+W Ue3Cjyx8Y0wDkLPw7fblF8ZQRudYSlmamJfmUe3gYwomxwvr0LL8Iu8sgfL3sZd61rfg GN3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:organization:subject:cc:to:from; bh=9l+l6NkXoC3nMH3AbZ7nZ/+1u6y2JqUx8t36a6u+Loo=; b=hrZ9OQRJP09d02j4kEs9dT/Qc3JyQ2g9PHxb8mfB/P9TEjMr4hagj/2NrcZL6GdBQn yRv0GbFqobFz0rkEhtReK7iOEaN+033vwVCaC2dRqfbm7PH5pOaWbZyn8OyC3jVRBKX8 ZPf+ataZLfJwvSxOfOvi9s5UkHe+PPcFTS9svp5/axCfFZzQ+USGdoOKs7+v0vyqaKKm So2yMdjjAu7EpicfdzxYhT4o3x3s1DrQ+sohHY8yrJsa5DP8EUsVTKT5TqZcXljd2uJy DK26AQRJZIEgwoDV5V2PMP8+efzLj9PSj4m1NMYw1rnjOPtb1sVAZcq2ftApgefJz6bH jfFQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l12si2646190edv.556.2021.08.13.12.49.06; Fri, 13 Aug 2021 12:49:29 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233752AbhHMTr6 (ORCPT + 99 others); Fri, 13 Aug 2021 15:47:58 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:59904 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230440AbhHMTr6 (ORCPT ); Fri, 13 Aug 2021 15:47:58 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 4FD241F44A5A From: Gabriel Krisman Bertazi To: Will Deacon Cc: shuah@kernel.org, linux-kernel@vger.kernel.org, peterz@infradead.org, luto@kernel.org, linux-kselftest@vger.kernel.org, kernel@collabora.com Subject: Re: [PATCH v2] selftest: Add test for Soft-Dirty PTE bit Organization: Collabora References: <20210603151518.2437813-1-krisman@collabora.com> <20210813150009.GC8451@willie-the-truck> Date: Fri, 13 Aug 2021 15:47:23 -0400 In-Reply-To: <20210813150009.GC8451@willie-the-truck> (Will Deacon's message of "Fri, 13 Aug 2021 16:00:10 +0100") Message-ID: <87lf553z5g.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Will Deacon writes: > On Thu, Jun 03, 2021 at 11:15:18AM -0400, Gabriel Krisman Bertazi wrote: >> This introduces three tests: >> >> 1) Sanity check soft dirty basic semantics: allocate area, clean, dirty, >> check if the SD bit flipped. >> >> 2) Check VMA reuse: validate the VM_SOFTDIRTY usage >> >> 3) Check soft-dirty on huge pages >> >> This was motivated by Will Deacon's fix commit 912efa17e512 ("mm: proc: >> Invalidate TLB after clearing soft-dirty page state"). I was tracking the >> same issue that he fixed, and this test would have caught it. >> >> Cc: Will Deacon >> Signed-off-by: Gabriel Krisman Bertazi >> >> -- >> Changes since V1: >> - Fix last minute build break with page_size >> --- >> tools/testing/selftests/Makefile | 1 + >> tools/testing/selftests/soft-dirty/.gitignore | 1 + >> tools/testing/selftests/soft-dirty/Makefile | 9 + >> .../testing/selftests/soft-dirty/soft-dirty.c | 254 ++++++++++++++++++ >> 4 files changed, 265 insertions(+) >> create mode 100644 tools/testing/selftests/soft-dirty/.gitignore >> create mode 100644 tools/testing/selftests/soft-dirty/Makefile >> create mode 100644 tools/testing/selftests/soft-dirty/soft-dirty.c > > Although I think adding a test for this is great (and I certainly wouldn't > want to get in the way of that; quite the opposite), I notice that we > already have test_softdirty() in selftests/vm/madv_populate.c. Would we be > better off extending that test instead of introducing another one? Hi, Will. Thanks for the review. Looks like selftests/vm/madv_populate.c was merged after I sent this, which explains why I missed it. From a quick look, it also doesn't verify the corner case of I'm checking here. I will look into merging the two tests, or at least moving this to vm/ and remove the overlap. Thanks, -- Gabriel Krisman Bertazi