From patchwork Sat Feb 24 21:50:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barry Song <21cnbao@gmail.com> X-Patchwork-Id: 13570665 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 81691C48BF6 for ; Sat, 24 Feb 2024 21:50:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D45CD6B00D1; Sat, 24 Feb 2024 16:50:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CCEB16B00D2; Sat, 24 Feb 2024 16:50:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B6F056B00D3; Sat, 24 Feb 2024 16:50:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id A39526B00D1 for ; Sat, 24 Feb 2024 16:50:44 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 4C954801ED for ; Sat, 24 Feb 2024 21:50:44 +0000 (UTC) X-FDA: 81828042408.18.2B0176F Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) by imf06.hostedemail.com (Postfix) with ESMTP id B9725180012 for ; Sat, 24 Feb 2024 21:50:41 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=RusOXTsL; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of 21cnbao@gmail.com designates 209.85.210.54 as permitted sender) smtp.mailfrom=21cnbao@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708811441; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=ydh9YpZ5plBfJp+BJ1ZlCj0CTUl0s4YGZgmpPJqLx+E=; b=701dDh2qe3sFztce4PITbJJf3FtYX7yjU8yhksFmZ2IZeGhBRPXJibz4DPMFOQeSTh2GhS u2XhPgOS9hBrLEb0JwDiP1vMMNrGOSxCayK3I0pKNKCnOqMxe991xaWvQ6dRjgWkSoMibz yqaEVw1reh0LBjsEPLHf8bFl9h4ZzIU= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=RusOXTsL; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of 21cnbao@gmail.com designates 209.85.210.54 as permitted sender) smtp.mailfrom=21cnbao@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708811441; a=rsa-sha256; cv=none; b=alHFOFwgrpjrfYhZI4tQe+hMljCPoW3AtoCStXfTBONGcfDm4/LyTpNpRCgNdAefQhuyRg bTqJvv+w33df/lSqG4TsMCpywqAtz6bPhIr3M15FTOuT7diQ4TReRaH3y3gPj8QNa6rz1a j2a3/2OiQlHE4yzpaglUMs6lsjvO87A= Received: by mail-ot1-f54.google.com with SMTP id 46e09a7af769-6e48e2270d0so524574a34.3 for ; Sat, 24 Feb 2024 13:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708811441; x=1709416241; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ydh9YpZ5plBfJp+BJ1ZlCj0CTUl0s4YGZgmpPJqLx+E=; b=RusOXTsLsmE84bbkHvzLOGRFeGcjEliJtKXAxPEaU4JRzu2wIRRLJajMuZTe6OolVr iK7v0hBvKyxSVcYAqCaXHI/LbYwMeV6nE64vAMye39oEIOYh3kpWW+ScoWDWsr67bdHh pgOHcU3Vb5dFEghHkZDv5Bo4sc5pZ9IWgPc88NUlTiCjU0HC7I/weCMsrHnDdOgZS7Ls ra91KmZj0KzXFiFuFgYvggB8xYIyobrP+qat+CWLxKAcV86sLrqHfWDbGOj02RVf7oj2 F4jcmMUmDW588THuMCeK+NY6bOdpYCHr+ebtxhi/7Zr3xN2JtyxHT0UJeDdBUZjFjTWm 6iCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708811441; x=1709416241; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ydh9YpZ5plBfJp+BJ1ZlCj0CTUl0s4YGZgmpPJqLx+E=; b=nQ9Em/+a1MkdGcQ1M7sEU/elq+mjy01bnoTbaP4diJbDxA54H5VYWcOPp7lSTPfOq8 ECuHmRlIDDfyeL7IsZc4apsdJ+5fqmALTeOoXg/3Mwlli9soSd+/2smc0/yXqkeyuaI1 dndUmt4wfXeDvvr4v75/3KtzjngWfXVmA7AWX7zKbkTNstXqY8RsAu1UmxCL/NNJt1Ct LTs9S7VA8WM/UHp4MaGiK5I7QJIMX201boT7D00mE5sBpHeXSpXDrjZPFhQiOL1V1piv /jLhMBP4pJEjjlUKiatybDQA5ThQk9ph/wRwtA8JSEU4XeaT0QVrbc0idmGYaCT86tP4 bIRA== X-Forwarded-Encrypted: i=1; AJvYcCWSA3/K7XQOo+j6RHskq4EYhUF5sHv8Ho9ICGsqO151RKCvx4TZKj2hWpg8SENlt/uEzQUBMEu/o+EKEK02hZjpR64= X-Gm-Message-State: AOJu0YwXbcCSVNvMHStmvNSKeilM+kC+kVRoQDNgnLnwt+/B2blFgoHl tdjb/BHXTau0pp7fs+U4tTwbAJcvC04Y8CNV1inGC7KtsX6kJf4H X-Google-Smtp-Source: AGHT+IFibMKAm7HJ/s6TRaLHq4riuHRV1LaOYrAXiM9s7Vh3AFlvSPBPKaMqLJjA0MKvOhsC6rc4jw== X-Received: by 2002:a05:6830:4414:b0:6e4:82a4:742e with SMTP id q20-20020a056830441400b006e482a4742emr4515589otv.0.1708811440809; Sat, 24 Feb 2024 13:50:40 -0800 (PST) Received: from barry-desktop.hub ([2407:7000:8942:5500:fae4:3bff:fecb:410]) by smtp.gmail.com with ESMTPSA id du15-20020a056a002b4f00b006e4bcdcff43sm1509866pfb.78.2024.02.24.13.50.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 13:50:40 -0800 (PST) From: Barry Song <21cnbao@gmail.com> To: corbet@lwn.net, linux-mm@kvack.org, akpm@linux-foundation.org, damon@lists.linux.dev, linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Barry Song , SeongJae Park , Minchan Kim , Michal Hocko , Johannes Weiner Subject: [PATCH] Docs/mm/damon/design: describe the differences for pageout's virtual address and physcial address Date: Sun, 25 Feb 2024 10:50:23 +1300 Message-Id: <20240224215023.5271-1-21cnbao@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: B9725180012 X-Stat-Signature: 9kqjyj6kj8znbjst84ckt1wjtf37whpb X-Rspam-User: X-HE-Tag: 1708811441-949525 X-HE-Meta: U2FsdGVkX18vgGspQR72JsnFKEbQLcjZUVzJxSjy6xncQ7PzOzHazxosr6ienpTbyAyxdKQ2r9aptxLu+JxZn1YrSX18Ro8cHq1rrPvRH0157wWn4E8IeWqwEHbQsarGN25r6XKESvCtcHeTi/xRcr14JwcQsUJuu7wKP+tomSE5B4DWbZstRzu6h1knPSgH/wG5nwfhsglleME03j4kdt5PJrDlBkZmCmSBF5UJ4NGwBRW+oCq4ft/QHrPO5K/VNgE2qMi4yOadmlS79up8D30j0L0Ckd0Xj8t24pGC7abKP1YGzlhqtt7d7zwLLDOwJtc3ZaBHpstpxwuByN5JxZoO+EzBNmR6p3kzUizTSK52EnHEiN2/ZTVzcMqoRa6ZUVkgfp5su3ka4M29EX2PL+cQ26GyMeOIayMo9dm4RIEUYGs1qxUSXug/L3we1xE6vQvHej9Xttkakpx+uXp5OOhaDZD8NB73gDiiexwhw2D37xSVdpp/urz3TQ4/wr7YCFL0uVxFIuvxfAYYNhwWIdlVwkP5H1VIvqoJ9RSSXkNFwOqBxWq2/nUE5DJstq/RxZq8ibVD8ANJO54lkUmQzPCTGJgwltWRiMf78ZTrzHwH3ultkOl/dbvJgeNqB+F6CFrY735p/D9YeKEz4bX3tmu53ba8QnVHtO9gFrLgcBcrHgLFK0jWLmrbXos+txccbvtBrEQJOMJkxGqM3A1cjyMULv6+Opmeq0fQ+U4AS8bZUjbr25olxwDQs5i6y3qiHNVevW3bIrl1k0CteFrA7P5KjmPVm79AzwPyAO7e2S+0khKhNgOqvGdrZzOgKgfv+b5pAdUQk/nLmn8pERaNvJrDPjWfG+PF3pNVx/REhTGyDFJE3/d0TqX6I/QtgH1t6vc+jG/C9PTtu18hBaLMVyOsnMN4Hr9XOlJPExmIlqsi/3sW3ZNwt4ZrSP6Bjq3gQavUVy5VYvtqGvRIXhJ XyeBomiz 5OmBlO29T4G8cmp1RffEPlHkCmevj3qxtZoktV8K9UiEUHmheu/Jun90Dq/I23GYe7n1eV6sBkC/fUsehqYol8oyg6s9vDkI/sODUefj/XwK+KSY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Barry Song The doc needs update. As only in the case of virtual address, we are calling madvise() with MADV_PAGEOUT; but in the case of physical address, we are actually calling reclaim_pages() directly. And madvise() with MADV_PAGEOUT is much more aggresive on reclamation compared to reclaim_pages() on paddr. Cc: SeongJae Park Cc: Minchan Kim Cc: Michal Hocko Cc: Johannes Weiner Signed-off-by: Barry Song --- Documentation/mm/damon/design.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index 8c89d26f0baa..6c50743552f5 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -315,7 +315,13 @@ that supports each action are as below. Supported by ``vaddr`` and ``fvaddr`` operations set. - ``cold``: Call ``madvise()`` for the region with ``MADV_COLD``. Supported by ``vaddr`` and ``fvaddr`` operations set. - - ``pageout``: Call ``madvise()`` for the region with ``MADV_PAGEOUT``. + - ``pageout``: Call ``madvise()`` for the region with ``MADV_PAGEOUT`` if + the region is using virtual address; otherwise, call ``reclaim_pages()`` + for the region if physical address is used. + ``madvise()`` with ``MADV_PAGEOUT`` is aggressively reclaiming memory + when pages are not shared by multiple processes. Differently, paddr's + pageout will do the best-effort reclamation by scanning PTEs to figure + out if pages are young, if not, pages are reclaimed. Supported by ``vaddr``, ``fvaddr`` and ``paddr`` operations set. - ``hugepage``: Call ``madvise()`` for the region with ``MADV_HUGEPAGE``. Supported by ``vaddr`` and ``fvaddr`` operations set.