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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1EB7C4332F for ; Fri, 25 Nov 2022 11:38:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6D7096B0071; Fri, 25 Nov 2022 06:38:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 686FB6B0072; Fri, 25 Nov 2022 06:38:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 54E306B0073; Fri, 25 Nov 2022 06:38:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 468B76B0071 for ; Fri, 25 Nov 2022 06:38:48 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1CCD716121C for ; Fri, 25 Nov 2022 11:38:48 +0000 (UTC) X-FDA: 80171767536.01.BDFD11A Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by imf11.hostedemail.com (Postfix) with ESMTP id B3BC04000F for ; Fri, 25 Nov 2022 11:38:47 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id z3so2880194iof.3 for ; Fri, 25 Nov 2022 03:38:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hev-cc.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=E7IgBRLrN26csjoyOlj7OXuCSIOPcVr1KT0fOqHZPDc=; b=i+seDolEghhuGWo4CZLpJEYiXAPXra8oIC4ft92+JCY+rJv52518iM+XPtErh2QXlS JNrPO9SAq1CrpF3azQqUepsSDjBnSNsoGnS5ewsrnLxnxCHzOH24HyNMnJHubCC46Bn0 zbwItDd0TcJ5fqoB+GVrawppY2ItfLbZM0jv0H8+BelmB5mqV5J1L55jev+H4WY3RldS 6hqpi8HOP5AtktrnZ1sWeCHcX5m206I4+Gs3NTNlnMkBgtF1WtV7PwJpEJaH5vf5OKIQ SZ6Wrm4VRqpZELPQIRH1QS7sjLxguJPynk8nZmfUgpGvjGufNzVT0kSBcg3kAoK9GR2/ EXuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=E7IgBRLrN26csjoyOlj7OXuCSIOPcVr1KT0fOqHZPDc=; b=VlP3BAGPONiwcqs+4JAYDq1iV6A3ZSYmNa16JG+pkIGDI0ef9c96JoHhAHHkR5VaZ7 SNKGjAJ7TsOW3jFnTZOCjdVCNp3BfqW5XkQQBNesZDO1FStf5lTwErpZr39XC3qwIZ+e ubat7by+98xSo/AxNVPIve+UE91NAzxGNy8KJIK4abZbcsfUs5Iss9G3+LFYXxw61dwr lRf/otKtY9sb/WGmjI/EFclL/pL1Qn+0ygw6vGResxbLmIcTaNnSbr3aSsH9ucf3KeNI Ep+HiFiJdhny/JdLV8eC5IP4U6ONyAzEyKeXVx3NwqjxRrAj9fJH1t/3OXFDma02D7G7 ASiw== X-Gm-Message-State: ANoB5pnzKVDzZEWed6MdB8tWdd+Bdk6ZSBpsbhz3kgm+OKuut7khiDEP 29en0ShMph9/Ph0BaPxhppP60W56tTclpb7Uw9Ogmw== X-Google-Smtp-Source: AA0mqf55LmzyS42LjSv7R5iHwxmtVimDa2+KoQzr2KnDWuGuNNL/pfG716wbX7eAWauoQodww+7KQQE34AqVc1tTDRc= X-Received: by 2002:a02:ca45:0:b0:363:a4ae:5a80 with SMTP id i5-20020a02ca45000000b00363a4ae5a80mr17599519jal.105.1669376327025; Fri, 25 Nov 2022 03:38:47 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: hev Date: Fri, 25 Nov 2022 19:38:36 +0800 Message-ID: Subject: Re: Test case for "mm/thp: carry over dirty bit when thp splits on pmd" To: Peter Xu Cc: Anatoly Pugachev , Thorsten Leemhuis , Sparc kernel list , linux-mm Content-Type: text/plain; charset="UTF-8" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669376327; a=rsa-sha256; cv=none; b=KxFip/0V5SIQZI1e8/lwC+vCwLoL3zZ+BLHFGNdACDfDcBsWPD8c+z/DQHuj9FmBujH7JK E4FZ8gFh+FI8TbMYCnsAVbrbhZNxvoEIsKq2nonuGpuW8JK96oAkAgNSFEAbAAcXeG81Pw UpGPcp1n0dsuyu17q/N4jr4cGtWR2xk= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=hev-cc.20210112.gappssmtp.com header.s=20210112 header.b=i+seDolE; spf=pass (imf11.hostedemail.com: domain of r@hev.cc designates 209.85.166.41 as permitted sender) smtp.mailfrom=r@hev.cc; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669376327; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=E7IgBRLrN26csjoyOlj7OXuCSIOPcVr1KT0fOqHZPDc=; b=pYBK2T15tZgAvRoGPQ+l8+nrTlsIOH47nRs4N6QJh9xZBkRuFu2uINjvaHf7Irkg4bd3bH vfeHkFIgIJowIR/wafCDozSRTE8LOAroNtLDG8erNHpk3VqyHrbmpMNftqKBFCIUHWHsw1 z1cymg3ppoS2k9UVcoJNCGEzuH65ZNM= X-Stat-Signature: 1ae4hnwab8c3ajh8wi9azzwdcusaak66 X-Rspamd-Queue-Id: B3BC04000F X-Rspam-User: Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=hev-cc.20210112.gappssmtp.com header.s=20210112 header.b=i+seDolE; spf=pass (imf11.hostedemail.com: domain of r@hev.cc designates 209.85.166.41 as permitted sender) smtp.mailfrom=r@hev.cc; dmarc=none X-Rspamd-Server: rspam10 X-HE-Tag: 1669376327-806292 X-Bogosity: Ham, tests=bogofilter, spamicity=0.091236, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Nov 22, 2022 at 2:55 AM Peter Xu wrote: > > Hi, Anatoly (or/and Hev), > > On Wed, Nov 16, 2022 at 01:45:15PM +0300, Anatoly Pugachev wrote: > > On Wed, Nov 16, 2022 at 11:49 AM hev wrote: > > > > > > Hello Peter, > > > > > > I see a random crash issue on the LoongArch system, that is caused by > > > commit 0ccf7f1 ("mm/thp: carry over dirty bit when thp splits on > > > pmd"). > > > > > > Now, the thing is already resolved. The root cause is arch's mkdirty > > > is set hardware writable bit in unconditional. That breaks > > > write-protect and then breaks COW. > > > > > > Here is a simple and fast testcase (It may be helpful for sparc64): > > > https://gist.github.com/heiher/72919fae6b53f04cac606a9631100506 > > > (assertion: c sum == 0) > > > > Just tried on my sparc64 VM - fixed vs old (non-patched) kernels... > > > > fixed kernel (6.1.0-rc5) running ./a.out: > > mator@ttip:~$ ./a.out > > c sum: 0 > > p sum: 35184372088832 > > c sum: 0 > > p sum: 35184372088832 > > c sum: 0 > > p sum: 35184372088832 > > c sum: 0 > > p sum: 35184372088832 > > c sum: 0 > > p sum: 35184372088832 > > ... > > > > old (non-patched) kernel (6.1.0-rc4) : > > mator@ttip:~$ ./a.out > > c sum: 35150012350464 > > p sum: 35184372088832 > > c sum: 35150012350464 > > p sum: 35184372088832 > > ... > > I've got another patch attached that might be nicer to fix this same > problem for both archs but without dropping the dirty bit, could you help > check whether it works? The tesecase PASSED with this patch and without: * "Partly revert "mm/thp: carry over dirty bit when thp splits on pmd" * "LoongArch: Set _PAGE_DIRTY only if _PAGE_WRITE is set in {pmd,pte}_mkdirty()" Ray