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=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 06507C47257 for ; Fri, 8 May 2020 18:32:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C33A12192A for ; Fri, 8 May 2020 18:32:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cmpxchg-org.20150623.gappssmtp.com header.i=@cmpxchg-org.20150623.gappssmtp.com header.b="q2dyjdEb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C33A12192A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1F872900012; Fri, 8 May 2020 14:32:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 10A47900005; Fri, 8 May 2020 14:32:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC692900012; Fri, 8 May 2020 14:32:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0009.hostedemail.com [216.40.44.9]) by kanga.kvack.org (Postfix) with ESMTP id C74A0900005 for ; Fri, 8 May 2020 14:32:44 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 894C02C0C for ; Fri, 8 May 2020 18:32:44 +0000 (UTC) X-FDA: 76794397848.02.level85_6f3561eaab422 X-HE-Tag: level85_6f3561eaab422 X-Filterd-Recvd-Size: 5604 Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Fri, 8 May 2020 18:32:44 +0000 (UTC) Received: by mail-qt1-f194.google.com with SMTP id b1so1357484qtt.1 for ; Fri, 08 May 2020 11:32:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WjwifLkaxtnwjsDLki9oTn/ODVTE0c1W9xwEMFneqd4=; b=q2dyjdEbv83IUE3u02r2JwYp7811qVwPgshXKCrQ9XsOoThuy+yCgx3eE+3O06I4nk sA2UB6pDLm7Cl3ukEoSeqZ4absWqRl+rAuxVm35o9C8uulHk6tDaLg2OW64hPvYjMfPq h1nO3+CuPO7MSvFT8px0tCOrBddzqfjGfIsySPjI7CJLvGVVKfGcW9YX0CHvGlWCu3eI ZSOGDPjXfO7ba7ayjNCh1zngQEJvJ0Q7F/lJ9RAxmpg0eca0qEWUl/Zhn6BNtOlpc3JP KMXOdTZnVyl63bvpRi5/fbOGw/EtLtsnjpmczC5i18yY0lhPEZL3g44yjE/BuRqyt+9f tzQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WjwifLkaxtnwjsDLki9oTn/ODVTE0c1W9xwEMFneqd4=; b=WXQ/WFX3CrlFBq9lJVfS0sBQzoIVeukFw4B27XB6scTKfweNEDwNLoItH47mfnvUad /wM1at1meXgEhvM19Lp9wKy+8iQCszNF1C6LUfpSlUoKEzT3Ru+bNYFuXgeo68nHxXxJ GqksiJtvDuWGc4CqIqARjChXbun3QLjDNQURg7xDPTB4HVoulXUOsWHtTSNJGRDAOyeF dsHFt8hhSkKxkeK/kSPXkxKMVLTT2lpGdOTZ7UnoKokiVUV9r8Ygqd07JnwifiWiiTeZ zyw6M7H/qzqttqlYgP0D+xqmsJhMqOSbTmK5W4msHuGTAsxoyp/KUNdaVSuFmtsAObZv sbHA== X-Gm-Message-State: AGi0Pub18XKkhfrRp187edhpV1bMcG74HpsGXFO33SWIIMxFe7HNvaPq bBltwR+D9GEWEIsLckXAt3v9jw== X-Google-Smtp-Source: APiQypKVCx22J2K5w35bf60sV1gZioeQd40D9P2B8Ud1CnlBKzSyhGcvkchitCvEL8araIDX3HOMIw== X-Received: by 2002:ac8:2c4f:: with SMTP id e15mr396815qta.27.1588962763459; Fri, 08 May 2020 11:32:43 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:2627]) by smtp.gmail.com with ESMTPSA id u11sm2090127qtj.10.2020.05.08.11.32.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2020 11:32:42 -0700 (PDT) From: Johannes Weiner To: Andrew Morton Cc: Alex Shi , Joonsoo Kim , Shakeel Butt , Hugh Dickins , Michal Hocko , "Kirill A. Shutemov" , Roman Gushchin , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 17/19] mm: memcontrol: document the new swap control behavior Date: Fri, 8 May 2020 14:31:04 -0400 Message-Id: <20200508183105.225460-18-hannes@cmpxchg.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508183105.225460-1-hannes@cmpxchg.org> References: <20200508183105.225460-1-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: From: Alex Shi Signed-off-by: Alex Shi Signed-off-by: Johannes Weiner --- .../admin-guide/cgroup-v1/memory.rst | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Documentation/admin-guide/cgroup-v1/memory.rst b/Documentati= on/admin-guide/cgroup-v1/memory.rst index 0ae4f564c2d6..12757e63b26c 100644 --- a/Documentation/admin-guide/cgroup-v1/memory.rst +++ b/Documentation/admin-guide/cgroup-v1/memory.rst @@ -199,11 +199,11 @@ An RSS page is unaccounted when it's fully unmapped= . A PageCache page is unaccounted when it's removed from radix-tree. Even if RSS pages are ful= ly unmapped (by kswapd), they may exist as SwapCache in the system until th= ey are really freed. Such SwapCaches are also accounted. -A swapped-in page is not accounted until it's mapped. +A swapped-in page is accounted after adding into swapcache. =20 Note: The kernel does swapin-readahead and reads multiple swaps at once. -This means swapped-in pages may contain pages for other tasks than a tas= k -causing page fault. So, we avoid accounting at swap-in I/O. +Since page's memcg recorded into swap whatever memsw enabled, the page w= ill +be accounted after swapin. =20 At page migration, accounting information is kept. =20 @@ -222,18 +222,13 @@ the cgroup that brought it in -- this will happen o= n memory pressure). But see section 8.2: when moving a task to another cgroup, its pages may be recharged to the new cgroup, if move_charge_at_immigrate has been cho= sen. =20 -Exception: If CONFIG_MEMCG_SWAP is not used. -When you do swapoff and make swapped-out pages of shmem(tmpfs) to -be backed into memory in force, charges for pages are accounted against = the -caller of swapoff rather than the users of shmem. - -2.4 Swap Extension (CONFIG_MEMCG_SWAP) +2.4 Swap Extension -------------------------------------- =20 -Swap Extension allows you to record charge for swap. A swapped-in page i= s -charged back to original page allocator if possible. +Swap usage is always recorded for each of cgroup. Swap Extension allows = you to +read and limit it. =20 -When swap is accounted, following files are added. +When CONFIG_SWAP is enabled, following files are added. =20 - memory.memsw.usage_in_bytes. - memory.memsw.limit_in_bytes. --=20 2.26.2