Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp958925pxb; Fri, 13 Aug 2021 10:04:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwq1ucpxj5Z70AXJtqjjA4+QN3YcGYrAG3A8b2TVi8LdSnEq7lZZPuI+G6OmSVAkTXSWTbk X-Received: by 2002:a5d:914b:: with SMTP id y11mr2743766ioq.6.1628874253067; Fri, 13 Aug 2021 10:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628874253; cv=none; d=google.com; s=arc-20160816; b=PRi9nQZ7hFZnMJSkWyAz4LyNufrQeMgBiqocbIhSoyPtjx0/Lht/71CjZiEQSiRBgb MT/EzYpTU0+ZbBgGoZfTSzXWVJLWNtdEZqIEqUNWh1S+SGacBVOWgc7gxltl+BCeokx7 SF744nhtLvrcFa8b7SMrfcxdJbRkITXVZucgX3Yry0jPVFxDD2tJ3281DyAM/3kCi+jR jAf6mjbV/QIFQphLixZyzSlyjt6Bujqr9JB2bmJoRNqlhgHDZj2/cU4ilcQD+Ag6CvQi x1Ziq+nLHw9hmxamRcJug6QLfGaP4WzyZG6h7mm54B7jt3Zz8XSm8l7XrPsgCyywLuY1 OFOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=HxAMhOwlaGbiu2MwLcHN198xtZR09Lf5jAci2x4L4V0=; b=ThIS/3CiGLIGV0/XfIc13/RurOlkUKz1usfiE3+3Q3cN+5zZIMA+NaoViGgG7ip731 JSZ/etsIGs/W8Pjsynz6rFi29VGQygxEWeUqHDEGV8l7GZb6BygGSGeF1zQngfxydqpe PQxGLdHr/EkPi90R2BJl9IueFrn4pbN5Tnh4HW+DTlFPbpU+nwwd9bhvKlckjYs3db62 sonUU2jFSeikNXTMHRDDiDw5fXdI8az12it0ZlwY6g+ouL56d7CRi5MCSeHAWcc0di2Y 1LbdEDwc1IlBvHvbYujcggagh0oUvdFe0hEYLVO8ekINteHZUMAoY5yIE/7qFlX23uZs AERQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OKct3yRh; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si80717jat.85.2021.08.13.10.04.01; Fri, 13 Aug 2021 10:04:13 -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=@kernel.org header.s=k20201202 header.b=OKct3yRh; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241055AbhHMPAn (ORCPT + 99 others); Fri, 13 Aug 2021 11:00:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:46168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241035AbhHMPAl (ORCPT ); Fri, 13 Aug 2021 11:00:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 36B3A610F7; Fri, 13 Aug 2021 15:00:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628866814; bh=rJVB8c8zbROro7cBJd32sE+qX454V0M11ELW5v/GB3c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OKct3yRhUjIGcZVMd3+a4SEO46LXuMVjuhR1kUj18Pdtt+l/GKCcxfY110R9CPNby GzbXyFA7YWqSPKSsfSZ94Lm6ZLYTWaunQddsfcaxBBUYbm1SDOo/XLo8XBSEwSCVfJ mITOtkl3bE7gsfo+EcR95klekcpGOxipr0jS8/up6VE6fB6eCFt2XnXtaH5p1sNqfm MyKN46D33TQ05nuXjE5H398odFXpQOU16utmASAt/3URmksN3TNC3yxJDpHqdkTojj pxLSpp9sZ1QsiJqkvJnyw1Ctl6i5nBMGQ0cy6EIgCxaWRjtbzoWEe+o7ewZiCv3nyF 87NF/ZCBLw40w== Date: Fri, 13 Aug 2021 16:00:10 +0100 From: Will Deacon To: Gabriel Krisman Bertazi 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 Message-ID: <20210813150009.GC8451@willie-the-truck> References: <20210603151518.2437813-1-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210603151518.2437813-1-krisman@collabora.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Will