Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp277920ybj; Fri, 8 May 2020 11:35:06 -0700 (PDT) X-Google-Smtp-Source: APiQypJUKcftvN4O++UZ20Ig/L6SMAaTL8rgbrXoRlFkrA4x4VZ2ha91Us+EyYXx3Ttsh/jbLZrF X-Received: by 2002:aa7:d311:: with SMTP id p17mr3369504edq.73.1588962906518; Fri, 08 May 2020 11:35:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588962906; cv=none; d=google.com; s=arc-20160816; b=VoewnsQOh0aFt83etUSA9Sv8+g0qoBpVYtfWI8YL9YbXCtm3wz6KwUSWvV3gsuVueB Eou1rl0ZKr2EMciamrb0jh4/oxHuSyRMHxWceqBXeuXzaf5E5aUJYUSKxdqISE8LUgCF O7/5xaSzF9CrzONfRX7vm8iRBcgz/NRDWGUoCWc82P5yT0HFirguxzsJwsS93u4txJGx ULWo9lSBCfFGCmblBqNJjYMr+n9JrBrvQ7IP7/UG+t6++Xe/4bLEBVFOj/jMHlYcNi6v l4CwQAsY0mhIsGcmtP5iAq7NvqP4RwmqfTsGqcM5B4ZyxOMzUhyMKScXczzK5hX9efz1 TQ5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WjwifLkaxtnwjsDLki9oTn/ODVTE0c1W9xwEMFneqd4=; b=T0zFq6UTyt8He15XAsUumZVQRltilgwKStyy4I2dVhy3r5qsOVO36nlQxoFr6HnU0P 8ow8aeNf9HDho0rZLTllDcYL3BPmmhudbrUTndXezKAFa9LmsDm/M5BamtcyEYgeVJZK YxNwERWZtVSoT7dd2mO4fhMGavykVTgGfUt1Prh5sN7Ehwt90K4vrFWaFWRQ8c8nOFHv fVkPTeAByQLUwEnzxc1A6qHN69r44Jy5iCJDzrGPE0EqszXH4Oyre5TtetD6H9pyD8ob emw71NWbee8ZP6O7XKQUPKNpJpiAWoPfkcj0/BQL02Fxg/A6EIUhd1GVfUz0eJP+a4es yYHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=q2dyjdEb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o19si1415829ejm.258.2020.05.08.11.34.44; Fri, 08 May 2020 11:35:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=q2dyjdEb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727082AbgEHScy (ORCPT + 99 others); Fri, 8 May 2020 14:32:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728052AbgEHScp (ORCPT ); Fri, 8 May 2020 14:32:45 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38BC1C05BD43 for ; Fri, 8 May 2020 11:32:44 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id z90so2121322qtd.10 for ; Fri, 08 May 2020 11:32:44 -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=j6Awg2pK6jDxf8nKLkcStTdkgWD8lihSvjNNnskfWF29W2Ubnf73mW8cxfR8OaqDCB aw5XPlzRGlhrm0CIeTvR16OnjaW0DPSuOgawEeogb/RNJk0DZ6p0B9drOtWxR/RroVq4 yX60AOJR5Zf/YL4TPJZYTwUn+AagBq+TCYm5IQ7oUerYv94vQASho+PFjCU//IyR9YzS MfGkB5BxZ3UxNycapXJ/TEfLMyqgqn4MIfnTxw9LDKrCiTDc+J2yzgEkGZvkafLFS/vU sJOAAd/hKjUe/hQ9I5PmfG0m7MImsbsA3OmYLhtggIfJQcy3kbyrC+Ix5ReRHS/VrhsZ Obkw== X-Gm-Message-State: AGi0PuaUur5b6HCjRXxaoqVhU5POD+RpPMMVxNxxcE3z8XHCO1XRK2Fj GieYsYc+I1/l5wuDoaodkYHesw== 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: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/Documentation/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 fully unmapped (by kswapd), they may exist as SwapCache in the system until they 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. 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 task -causing page fault. So, we avoid accounting at swap-in I/O. +Since page's memcg recorded into swap whatever memsw enabled, the page will +be accounted after swapin. At page migration, accounting information is kept. @@ -222,18 +222,13 @@ the cgroup that brought it in -- this will happen on 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 chosen. -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 -------------------------------------- -Swap Extension allows you to record charge for swap. A swapped-in page is -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. -When swap is accounted, following files are added. +When CONFIG_SWAP is enabled, following files are added. - memory.memsw.usage_in_bytes. - memory.memsw.limit_in_bytes. -- 2.26.2