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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 04286C5519F for ; Wed, 25 Nov 2020 14:15:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DF75F2076B for ; Wed, 25 Nov 2020 14:15:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mpi-sws.org header.i=@mpi-sws.org header.b="twDmgRCH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF75F2076B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mpi-sws.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CA0AD6B0071; Wed, 25 Nov 2020 09:15:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C2A9B6B0072; Wed, 25 Nov 2020 09:15:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA3B36B0074; Wed, 25 Nov 2020 09:15:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id 90F9E6B0071 for ; Wed, 25 Nov 2020 09:15:39 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 581578249980 for ; Wed, 25 Nov 2020 14:15:39 +0000 (UTC) X-FDA: 77523138798.28.pipe48_3f0900d27377 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 00EF66D7B for ; Wed, 25 Nov 2020 14:15:38 +0000 (UTC) X-HE-Tag: pipe48_3f0900d27377 X-Filterd-Recvd-Size: 4010 Received: from jupiter.mpi-klsb.mpg.de (jupiter.mpi-klsb.mpg.de [139.19.86.15]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Wed, 25 Nov 2020 14:15:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mpi-sws.org ; s=mail201904; h=Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: sender:reply-to:cc:content-transfer-encoding:content-id:content-description: resent-date:resent-from:resent-sender:resent-to:resent-cc:resent-message-id: in-reply-to:references:list-id:list-help:list-unsubscribe:list-subscribe: list-post:list-owner:list-archive; bh=GmMTofmzND+vqYFAD6svtp2cY0IlrJSaJ4bIPTLg+Ig=; b=twDmgRCH5sXg9oPFNz3ipcoQVO M2aYVfvGpQUtzr2ND4d1/Q0tHmpTN+4SveH5Up9492d+7iDmUqgLEnaJf60xxR0RKWDz80QWFEZmw n2Blt30B25UG72r959MMIkjp5M8N6gpv0uNd1cyRDtrWzoNwxLie0vDakxwuwTadNPq4=; Received: from srv-00-62.mpi-klsb.mpg.de ([139.19.86.27]:56626 helo=max.mpi-klsb.mpg.de) by jupiter.mpi-klsb.mpg.de (envelope-from ) with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) id 1khvZx-0002hS-R0 for linux-mm@kvack.org; Wed, 25 Nov 2020 15:15:33 +0100 Received: from mail-oi1-f176.google.com ([209.85.167.176]:34496) by max.mpi-klsb.mpg.de (envelope-from ) with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) id 1khvZx-0008El-Gg for linux-mm@kvack.org; Wed, 25 Nov 2020 15:15:29 +0100 Received: by mail-oi1-f176.google.com with SMTP id s18so2979978oih.1 for ; Wed, 25 Nov 2020 06:15:29 -0800 (PST) X-Gm-Message-State: AOAM5307Il+ExnGc/WbcVQnZPkgSyApFiYED6v/Acc++Bdd1AJiyjyZy q58ZFHYNiC0Kpa6JP9uzYebYclGZN/wB3d+7di8= X-Google-Smtp-Source: ABdhPJxMBQH0k93POt+eotFI8yKOJhvKNdHcsOdIIY5MEU60NHGjjJfRibA//HDcuck8mYpLA7rKDSvrlAA4kVYGeu0= X-Received: by 2002:aca:3205:: with SMTP id y5mr2292713oiy.162.1606313728152; Wed, 25 Nov 2020 06:15:28 -0800 (PST) MIME-Version: 1.0 From: Mohamed Alzayat Date: Wed, 25 Nov 2020 15:15:17 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Potential bug in soft-dirty bits (with test case) To: linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" X-RSPAMD-Score: -0.3 (/) X-RSPAMD-Report: Action: no action Symbol: RCVD_VIA_SMTP_AUTH(0.00) Symbol: ARC_NA(0.00) Symbol: FROM_HAS_DN(0.00) Symbol: TO_MATCH_ENVRCPT_ALL(0.00) Symbol: R_SPF_ALLOW(-0.20) Symbol: MIME_GOOD(-0.10) Symbol: PREVIOUSLY_DELIVERED(0.00) Symbol: TO_DN_NONE(0.00) Symbol: RCPT_COUNT_ONE(0.00) Symbol: RCVD_COUNT_THREE(0.00) Symbol: DMARC_NA(0.00) Symbol: NEURAL_HAM(-0.00) Symbol: FROM_EQ_ENVFROM(0.00) Symbol: R_DKIM_NA(0.00) Symbol: MIME_TRACE(0.00) Symbol: ASN(0.00) Symbol: RCVD_TLS_ALL(0.00) Message-ID: CA+32v5zzFYJQ7eHfJP-2OHeR+6p5PZsX=RDJNU6vGF3hLO+j-g@mail.gmail.com X-Bogosity: Ham, tests=bogofilter, spamicity=0.083344, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Everyone, I have noticed a change in the synchrony of updating the soft-dirty bits in recent kernel versions (5.6+). More precisely, up to kernel v5.5, the soft-dirty bits as parsed from /proc/pid/pagemap accurately capture the dirtied pages. Recently, I started testing on kernels v5.6 - v5.9, and I noticed that the soft-dirty bits are not immediately updated. I have prepared a short test that repeatedly causes at least one memory page to be dirtied, then scans /proc/pid/pagemap counting the soft-dirty bits. The test fails if this count is zero. In my observation, this test fails once in every 10-20 trials. The test defaults to 100 trials and can be found at https://gitlab.mpi-sws.org/-/snippets/1696 Is this non-synchronous propagation of soft dirty bits intended? If yes, is there a way to force the soft-dirty bits to be propagated to the page map entries immediately, or is there an alternative interface that has the synchronous behavior? Thanks in advance, Mohamed Alzayat