Received: by 10.213.65.68 with SMTP id h4csp66328imn; Wed, 21 Mar 2018 12:30:53 -0700 (PDT) X-Google-Smtp-Source: AG47ELumPAwEKmPLIwReH6E7QCIFLZQsX0tZHE+TNq5TIudWCdAxRbxZwtPm0CqhH6RmLjTeEMck X-Received: by 2002:a17:902:5814:: with SMTP id m20-v6mr20875938pli.311.1521660653040; Wed, 21 Mar 2018 12:30:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521660653; cv=none; d=google.com; s=arc-20160816; b=xSDM/eFMjDLnRU0PLhO+qMXwU2/SBXSCC7dLjKYRSQlNH0LCulBBAeCJEIKb5qtoFN 3QZygoMOgyL93CYOdT0lswpDMIbp/AXJxHu+6JtvBoWorMWM08h9BXTo4KNCPtPIYV3i HKrbhIwtW1TnEFOWAcqPmRQfiIB8a07UXWz5igiQpqsy8Pz1z73EguzqSJo4GkpOoD5o 9yLjFCcxIjAmKYd7DN2p0aUvlqNDqzo3cZmlcxRWsVeN6kwHnI07JrFacPQ2IBQvTU6N onEuDG89AQFvmiSvx11ewIzE1EiykPB7KUaqUsfrJc6NEKeUNZtfy5WjSV7VmbkIQoUa AY7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=bFSGxstJrPChTI/9QAIhIOXrhnae9vKbheD87dj2qT0=; b=BLEGJL7N15PkhL3TeHWTH+QEz9Bo9YMuzjimvsahraQ/CLcQVdRWuikQmuv3pxYEGo lt1jiEs8NxbNMU6oZw/bnVIQAGk4M+GzNwOnHVmOQ1lRfwpygpVaA4fiLMfVnMOCXCGP GIWSPzmjijU7JMqQLsvQ627f6R+pqfwoKnuoUknoMiY+qAkG9ZDAbFeJCNDveLmMwihJ d+eRYNBC+fRInjx97ka5ykuRO/0eBqS4uE1SUhh9AyVgr54cIsCWEyCRuNRBTdW6EsLx KoCzHh43PM0M9qlqjPmA30yvNdejujgpvXpyCjF6NtTuaOb4115Zbc0Akxp55E1pIZqB JMGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12si3531720pfk.42.2018.03.21.12.30.38; Wed, 21 Mar 2018 12:30:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753661AbeCUT3C (ORCPT + 99 others); Wed, 21 Mar 2018 15:29:02 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33710 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753089AbeCUTYo (ORCPT ); Wed, 21 Mar 2018 15:24:44 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2LJNlNo134228 for ; Wed, 21 Mar 2018 15:24:44 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2guv1147sx-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Wed, 21 Mar 2018 15:24:43 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 21 Mar 2018 19:24:40 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 21 Mar 2018 19:24:34 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2LJOYjb63176800; Wed, 21 Mar 2018 19:24:34 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C6D83A4040; Wed, 21 Mar 2018 19:17:16 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D1A20A404D; Wed, 21 Mar 2018 19:17:13 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.206.27]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 21 Mar 2018 19:17:13 +0000 (GMT) Received: by rapoport-lnx (sSMTP sendmail emulation); Wed, 21 Mar 2018 21:24:30 +0200 From: Mike Rapoport To: Jonathan Corbet Cc: Andrey Ryabinin , Richard Henderson , Ivan Kokshaysky , Matt Turner , Tony Luck , Fenghua Yu , Ralf Baechle , James Hogan , Michael Ellerman , Alexander Viro , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kasan-dev@googlegroups.com, linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@linux-mips.org, linuxppc-dev@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Mike Rapoport Subject: [PATCH 22/32] docs/vm: soft-dirty.txt: convert to ReST format Date: Wed, 21 Mar 2018 21:22:38 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521660168-14372-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1521660168-14372-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18032119-0044-0000-0000-0000053E734A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18032119-0045-0000-0000-0000287D78ED Message-Id: <1521660168-14372-23-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-21_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803210221 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Mike Rapoport --- Documentation/vm/soft-dirty.txt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Documentation/vm/soft-dirty.txt b/Documentation/vm/soft-dirty.txt index 55684d1..cb0cfd6 100644 --- a/Documentation/vm/soft-dirty.txt +++ b/Documentation/vm/soft-dirty.txt @@ -1,34 +1,38 @@ - SOFT-DIRTY PTEs +.. _soft_dirty: - The soft-dirty is a bit on a PTE which helps to track which pages a task +=============== +Soft-Dirty PTEs +=============== + +The soft-dirty is a bit on a PTE which helps to track which pages a task writes to. In order to do this tracking one should 1. Clear soft-dirty bits from the task's PTEs. - This is done by writing "4" into the /proc/PID/clear_refs file of the + This is done by writing "4" into the ``/proc/PID/clear_refs`` file of the task in question. 2. Wait some time. 3. Read soft-dirty bits from the PTEs. - This is done by reading from the /proc/PID/pagemap. The bit 55 of the + This is done by reading from the ``/proc/PID/pagemap``. The bit 55 of the 64-bit qword is the soft-dirty one. If set, the respective PTE was written to since step 1. - Internally, to do this tracking, the writable bit is cleared from PTEs +Internally, to do this tracking, the writable bit is cleared from PTEs when the soft-dirty bit is cleared. So, after this, when the task tries to modify a page at some virtual address the #PF occurs and the kernel sets the soft-dirty bit on the respective PTE. - Note, that although all the task's address space is marked as r/o after the +Note, that although all the task's address space is marked as r/o after the soft-dirty bits clear, the #PF-s that occur after that are processed fast. This is so, since the pages are still mapped to physical memory, and thus all the kernel does is finds this fact out and puts both writable and soft-dirty bits on the PTE. - While in most cases tracking memory changes by #PF-s is more than enough +While in most cases tracking memory changes by #PF-s is more than enough there is still a scenario when we can lose soft dirty bits -- a task unmaps a previously mapped memory region and then maps a new one at exactly the same place. When unmap is called, the kernel internally clears PTE values @@ -36,7 +40,7 @@ including soft dirty bits. To notify user space application about such memory region renewal the kernel always marks new memory regions (and expanded regions) as soft dirty. - This feature is actively used by the checkpoint-restore project. You +This feature is actively used by the checkpoint-restore project. You can find more details about it on http://criu.org -- 2.7.4