From patchwork Mon Jan 29 22:45:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nhat Pham X-Patchwork-Id: 13536473 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 918F0C47DA9 for ; Mon, 29 Jan 2024 22:45:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DE5F36B00A4; Mon, 29 Jan 2024 17:45:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D6E956B00A5; Mon, 29 Jan 2024 17:45:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BC1696B00A6; Mon, 29 Jan 2024 17:45:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id A876A6B00A4 for ; Mon, 29 Jan 2024 17:45:46 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 498F4A0186 for ; Mon, 29 Jan 2024 22:45:46 +0000 (UTC) X-FDA: 81733832292.04.D12E567 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) by imf23.hostedemail.com (Postfix) with ESMTP id 7BE1A140015 for ; Mon, 29 Jan 2024 22:45:44 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fILDoNhq; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf23.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.219.51 as permitted sender) smtp.mailfrom=nphamcs@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706568344; a=rsa-sha256; cv=none; b=cv3tUWwYr1brmPIuHkWHXo/VGrmW8QIXx/Bp7kqgy2iO7R5Wwrz5bmUg2fzWgoy6LaPbYV Un8E4hOY840q7cYeJe/9YrzGmfHb33NruxyHfl+ksMHVBI75z+VFVWHGmW4nXLnpaWiRxd U4yj9T6Qm4LDUNAK19XZOd6AnO7iCLM= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fILDoNhq; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf23.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.219.51 as permitted sender) smtp.mailfrom=nphamcs@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706568344; 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:in-reply-to:references:references:dkim-signature; bh=e3JKWr6vkV83y4YZraciKQHHZz9sGV8OXuuwrIDvmCQ=; b=CPjBBjIaHuFgRr9+/Pdt63zPu4TQvtAsN1ipSEKrG5huHiGzmPFLcP00S0dZXXl2tOtQWV MOnAwANykc38PofUL9JLjpWFd9aD/UBWSNMf8X3FoDzswefmAjEKiLZDetTTPC8cw79BvX S/rY5RZjLbue1VvhXCWo7J8dEdXtyCg= Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-68c37bf73aaso27592876d6.2 for ; Mon, 29 Jan 2024 14:45:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706568343; x=1707173143; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=e3JKWr6vkV83y4YZraciKQHHZz9sGV8OXuuwrIDvmCQ=; b=fILDoNhqIOqHz6r2ls1UQD2C5ibTWYtE8dugX2asEHKj7VXDidik69lhpYNpLMJ6v/ omUd9DNusntAh7qN1yH+YQRQgegNshag57J7tnaAdHujcb18j/R1n+UNsJU5BtPpHqfL JMbQd/gjsW7SOxYtTTKVTde16lyDh3l4dXigshR0omBwNTDlK2K0voKqJOM9hvtInd4u P+U5jrRrmdy5e4gTCpIbBpRsnMJG/itd+kPOM9nfqzwjY7ihwpm5jXfyW1RQ0wzykqLd gj2Pe9mSb6TxmATcHkt/M9bliixqo1ztXH6uwLmOFaBMR9+z1DRK9jZA0ibqtObyaNhR gHGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706568343; x=1707173143; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e3JKWr6vkV83y4YZraciKQHHZz9sGV8OXuuwrIDvmCQ=; b=c1mzG/v+WHWvyukceORzkPFQyj7/qFwOhfXOtSwwTubuvoL2DMc/64GU7icFnLKa+S j5k33NrVpCE8KAEaUcUMcthHjs897gz08BnaiJ14kbccgyz3q83h1KWUHAsDGJBW2ozL A8DfJx2bzr2MVlLvMNt5LpLFFzLlPYa5QhHliWTons8TqG6qQ2pW2IidFRJ1jGzfQtJi JpwYQIi56gtLjo/s1sQtqni/Zg+LesY5LK+KbHJeVMUBTTXoCWVxlEfQk2IQHtYhS0Rb QEPZc+5DFL+ac6w2763w0jC2W7SMQQreuTSX1rZyHlzVdBw06OhX1HOGXH+PSJ6gZujU Spcw== X-Gm-Message-State: AOJu0YxlhtyqzcJRUK8Kle3ZLoiC861b5IgmObzNVDzdDIqDIDAIRkBL KlF0g0YHAa76Mm27lqkrsMyJbvTnP3iS8ViWT8AK+Db8Mosq72kj X-Google-Smtp-Source: AGHT+IHGfpYkQIuBr797vwJUdfDqHN+zox8xp38LBl6covm60K0wtDOMjuoBeTuxSaVV/2VRXP0wFg== X-Received: by 2002:ad4:5dcd:0:b0:68c:4942:b0b0 with SMTP id m13-20020ad45dcd000000b0068c4942b0b0mr2981525qvh.100.1706568343643; Mon, 29 Jan 2024 14:45:43 -0800 (PST) Received: from localhost (fwdproxy-nao-116.fbsv.net. [2a03:2880:23ff:74::face:b00c]) by smtp.gmail.com with ESMTPSA id 12-20020ad45b8c000000b0068c501d0766sm1260449qvp.41.2024.01.29.14.45.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 14:45:43 -0800 (PST) From: Nhat Pham To: akpm@linux-foundation.org Cc: shuah@kernel.org, hannes@cmpxchg.org, yosryahmed@google.com, tj@kernel.org, lizefan.x@bytedance.com, linux-mm@kvack.org, kernel-team@meta.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH 1/3] selftests: zswap: add zswap selftest file to zswap maintainer entry Date: Mon, 29 Jan 2024 14:45:40 -0800 Message-Id: <20240129224542.162599-2-nphamcs@gmail.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240129224542.162599-1-nphamcs@gmail.com> References: <20240129224542.162599-1-nphamcs@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 7BE1A140015 X-Stat-Signature: c7cbwgfnngo3zgskoab84ddfjx1yonyg X-HE-Tag: 1706568344-988956 X-HE-Meta: U2FsdGVkX19IF5o7kKgSXULbLUqvH+P23ZhKI5AUoAjJAUA8MczDR+0IlquLoirLg6CyDJLXzuvZdIoeJmYBbnedcnlq8+xRAMgwoVLIpB0S6xy4/OQk3PB7SyvsAnHTEnTq4EBMAOo1pYYuQLu1PiR6uInuYxS2iHfgFN6E6c/FxhC8tde6zG9oUaSNj7gQVjA7f0NYLVBNH6sX5m3wxUlBC03nEUl1ovDm+AMK7+LYuVk9GhnAAapPMwQqsEOSsdcaoYKqZRiXVLaOtAHsS1YZX8At9YqWV0R8gYsjj7C23CuM+h1CCOJ37syA5H9zh2k/XuWjNEFP2G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xY3ajnKtffFsCMlJuPKXCmUkJanRrxYvjh17CI5Ptx2iyW1MOnl2JfkiHqrjM0cM= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Make it easier for contributors to find the zswap maintainers when they update the zswap tests. Signed-off-by: Nhat Pham Acked-by: Yosry Ahmed --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index fecebfc4c0dc..5f60faaefaf2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -24396,6 +24396,7 @@ F: include/linux/zpool.h F: include/linux/zswap.h F: mm/zpool.c F: mm/zswap.c +F: tools/testing/selftests/cgroup/test_zswap.c THE REST M: Linus Torvalds From patchwork Mon Jan 29 22:45:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nhat Pham X-Patchwork-Id: 13536474 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 DB06AC47DDF for ; Mon, 29 Jan 2024 22:45:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C11686B0087; Mon, 29 Jan 2024 17:45:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BC2446B00A7; Mon, 29 Jan 2024 17:45:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 99EDD6B00A6; Mon, 29 Jan 2024 17:45:47 -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 89F466B0087 for ; Mon, 29 Jan 2024 17:45:47 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 5CD2016044C for ; Mon, 29 Jan 2024 22:45:47 +0000 (UTC) X-FDA: 81733832334.20.20F19EC Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by imf26.hostedemail.com (Postfix) with ESMTP id 793EC140011 for ; Mon, 29 Jan 2024 22:45:45 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=GVkKlOvg; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.222.180 as permitted sender) smtp.mailfrom=nphamcs@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706568345; a=rsa-sha256; cv=none; b=P4NuZ3Groe4heQL4ca+ZjSuaCFFbqI5Ob75NhnhNGki4cMJs83Dcqf523T269dgdo892vF cHfzFnLupjePjknFlwCnXUKCWYPpu0jnbxC1J3GUfmpoJSeQRwJkTlB0/XfHNWU525gtMs B2/ZlabWFuOJq0qYogde8zNlYB4IO8I= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=GVkKlOvg; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.222.180 as permitted sender) smtp.mailfrom=nphamcs@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706568345; 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:in-reply-to:references:references:dkim-signature; bh=dC8jdsm04mIqNXpi4c3WwQu2utHfwjKvoXOteQVfINI=; b=HL36hLk6nWQyofxTwWv953WhuEsUjwG88IjQwghUG5o2Q2SDduMTW7mDlMt3Vefsna5Nz2 6DQTsxfwvx7xPyupvQkavgsFnGQCzu2q4llFK1VkYz6mlhGeMtoaR5cDIknLHCY8fo8pYD EYL5lUWlW1OxxF3S4IbIbmeCG3x7Hxw= Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-783eb452e01so186888885a.1 for ; Mon, 29 Jan 2024 14:45:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706568344; x=1707173144; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dC8jdsm04mIqNXpi4c3WwQu2utHfwjKvoXOteQVfINI=; b=GVkKlOvgM2h2uvGj5H7iJoPCdFCx1WNoWCLbPivIMQwc4CXPwSAETUQccc/B5MReXP A9l4vzf66FVYCJLB+ALO6zexVKNtK7pTpVR7i2GePlTO8MDflEWsN2JhjPZfW5+QZr4p KK/bWzHZP+/9Ce5t3eStIN0tdfXagWlCwXqL1ng63ESxNHDARpLvn2NOMWSCemTiwE3L ivbIuzko5eADexl9YUtO3qjJUSvchFZDjwSDxe1a+eZ+3LWwKQj4h2FMkOw7MmpmLIWe FB1GiU1G9R8/8nW5p3/aaj0gVKhc3YBbNmjYNVfcc9Iw9k5h5TdlwgSlXhXLXFL1bXvf EA3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706568344; x=1707173144; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dC8jdsm04mIqNXpi4c3WwQu2utHfwjKvoXOteQVfINI=; b=vtL3NhWu1rIyl+gQCJe7QrlPks/HwPrsy5kzlRbC8vskcNh6BmEOudnc+OHwbZz0UM mmsBTx3SAx/XOpN1euaL4jgHHiFNNAgnTCxnrfh06niVLIqjq0F7AEAoSiEPRg6VOsOd sJKUDcQE0T6aCpHh4W3EyuBKLFCmPhwVUhiTp+g9F/1nMI2P+M1/lAghgAignw+OYJTK 4bgvyCo+lLrbhdEq8bw+MZy5BAOjOz/6nYlv4rBO0sCixQsfQ/PHkHDvbY/XkygoD3GR wrcUir5y8BhqLe7t9SuD0SXTKNvF9GopQGretkIFNIsI0w+6rPRg1blucHXBtOAzlUmy Cdtg== X-Gm-Message-State: AOJu0YwbpTQWmztacd0dgQr/CueDVZ5NcArVVNKB6lBJTi4CTNjPFcUS tHS16Yixnz87PdH/Sla2JWPM8XJ+sSP/WP7neM7FEtcF3OZKb7qI X-Google-Smtp-Source: AGHT+IFHRDAjwttfHcY6DCVP5F3AhKrbmlzkwgYdhBdCAoj0RflAflHERJSdD2h9gDthZsxod44wkA== X-Received: by 2002:a05:620a:318c:b0:783:3cef:c885 with SMTP id bi12-20020a05620a318c00b007833cefc885mr9677984qkb.57.1706568344471; Mon, 29 Jan 2024 14:45:44 -0800 (PST) Received: from localhost (fwdproxy-nao-005.fbsv.net. [2a03:2880:23ff:5::face:b00c]) by smtp.gmail.com with ESMTPSA id c7-20020a05620a134700b00784087c7f21sm269076qkl.84.2024.01.29.14.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 14:45:44 -0800 (PST) From: Nhat Pham To: akpm@linux-foundation.org Cc: shuah@kernel.org, hannes@cmpxchg.org, yosryahmed@google.com, tj@kernel.org, lizefan.x@bytedance.com, linux-mm@kvack.org, kernel-team@meta.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH 2/3] selftests: fix the zswap invasive shrink test Date: Mon, 29 Jan 2024 14:45:41 -0800 Message-Id: <20240129224542.162599-3-nphamcs@gmail.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240129224542.162599-1-nphamcs@gmail.com> References: <20240129224542.162599-1-nphamcs@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06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AdGI I0n2tzVaDXXu5Lg1HGhLYMjUJqIokKq7zV05rHIyfQqPBm5DiH83UmUXaHbe7RkllSTdTtcufDyt2vV25Gy5M5QwbbA7/JaUi7ddN3+1h3YeO5TXq7yWcjry8HzJFlEJV28sRYXISQ27Yteh03iFMV5e9WZ3YNjXJ78RntrTFuKM81KcC2Tg0i9q0gBJ4amBNpurcubCClAbpdfOc73ZXz9g13gjBfarE7q8DIxNoBhDikNkIrrkhQO/NuZkmvsIJcngZ+0V7L4Ny25aUTeW78T3X5JAXps3WAozZoXnRbvZEF+xLmyE/KyiLB2BEAt7uHztLHqWuClTycO7uihp5ln3AT1jMzV0T7sWF7y728NJRe7k33GqYCKhDCC82qOZSqwpZ7VVhKsALEKlf+yNps6RzDyJI+b4m5NLDLJqTU8EXylww228pimU5abBp4nFfP6LxKOf7H8x5uzTjpDxMbHCRHvMVCUUgV4qxnDWhWgy9w44PXWg/fZgC1wq4apCdCxOyiZ+uxvkIOrsr7whWSyY0Sgo6EOONhxt/9O+CE4JwRHMoSlrn3RrBIYhWoPccyZlK X-Bogosity: Ham, tests=bogofilter, spamicity=0.012695, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The zswap no invasive shrink selftest breaks because we rename the zswap writeback counter (see [1]). Fix the test. [1]: https://patchwork.kernel.org/project/linux-kselftest/patch/20231205193307.2432803-1-nphamcs@gmail.com/ Fixes: a697dc2be925 ("selftests: cgroup: update per-memcg zswap writeback selftest") Signed-off-by: Nhat Pham Acked-by: Yosry Ahmed --- tools/testing/selftests/cgroup/test_zswap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c index 47fdaa146443..32ce975b21d1 100644 --- a/tools/testing/selftests/cgroup/test_zswap.c +++ b/tools/testing/selftests/cgroup/test_zswap.c @@ -52,7 +52,7 @@ static int get_zswap_stored_pages(size_t *value) static int get_cg_wb_count(const char *cg) { - return cg_read_key_long(cg, "memory.stat", "zswp_wb"); + return cg_read_key_long(cg, "memory.stat", "zswpwb"); } static long get_zswpout(const char *cgroup) From patchwork Mon Jan 29 22:45:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nhat Pham X-Patchwork-Id: 13536475 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 EBDE8C47DA9 for ; Mon, 29 Jan 2024 22:45:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 780886B00A7; Mon, 29 Jan 2024 17:45:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 72D186B00A8; Mon, 29 Jan 2024 17:45:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A95E6B00A9; Mon, 29 Jan 2024 17:45:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 429B56B00A7 for ; Mon, 29 Jan 2024 17:45:49 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 14CD940AAA for ; Mon, 29 Jan 2024 22:45:49 +0000 (UTC) X-FDA: 81733832418.07.2CA8752 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by imf15.hostedemail.com (Postfix) with ESMTP id 52729A000F for ; Mon, 29 Jan 2024 22:45:46 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=gO723lLs; spf=pass (imf15.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.222.180 as permitted sender) smtp.mailfrom=nphamcs@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706568346; 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:in-reply-to:references:references:dkim-signature; bh=xef0hVDdHdF2jNfb1sbGTppVQNq89HdiJsXx3j0Z+RA=; b=1neKXjsAk28Ga9K0UN+sRv4Huo34VLBxR6tdlv7/QRHj4YyCmHkoqNSYjqVDLR5jkY/f5r +N2/nMVjzB0eBe61Bitn7aTl4RSmatC85p7qQU6NDogOQe6nm6BQPJvXZxOcEWKWCKAFL1 oFOoAWzhUs0W2cCASq3qt1D9Bir4Kf8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706568346; a=rsa-sha256; cv=none; b=rOp0v4JscUpnWs1on43ZbWAeu5wPP6gPLuQKn6kLR1w8/eu4ExECbQWzffKANVC7IOo/J0 0bCsvWqoAMQZ7Q50IyIPi6Cof3uZPO3cqm8/PdDsFA8dyI9+5JLJ/d/Rnh0X4R3PbcTKlT 691K2HLdZmFiu6vGzqfewjrNcTpLgKo= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=gO723lLs; spf=pass (imf15.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.222.180 as permitted sender) smtp.mailfrom=nphamcs@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-783d4b3a00bso304391385a.3 for ; Mon, 29 Jan 2024 14:45:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706568345; x=1707173145; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xef0hVDdHdF2jNfb1sbGTppVQNq89HdiJsXx3j0Z+RA=; b=gO723lLsWoPnFW6iRt3FVD+EPwMPvjw1Va9ltfyRVuXXB9z9bdv6ispPuL/c85yri6 GuljeY9e2eWT9O0YtxjvaarXb1BfPCNJJWkT+7qUey+ldAleGgQMJvD/N9N0SGQ9ZfNp 9GfoaFFM70JOcnm1nYJKy5ymizBS3TffzYB0llzdcT522ak/yMZeeqIzvLEeUk0MGqEW aznKBGOStqZQc65TOjFbVYn0FWeK7oK2e+So/empIVPToATCPn9JUSYRtZuB4dPwMpTH RPCfZYuneRijzwup1A0Xf1viVH8TgIGqsvV2KkIJ4ufHTSh6/kqLdEyuUal+jzheIxgX 6HNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706568345; x=1707173145; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xef0hVDdHdF2jNfb1sbGTppVQNq89HdiJsXx3j0Z+RA=; b=H7yDdkhdlL4zHpIC3mt4DiyXkoAw+Cy0xFC6tCZbAr4AMVJEtE32A8j1qb2RrOVG2E wM/ZNAQ8qlS4hHeRPYFUhAfma/0UKijsjsNGZKk+DAdpm4BNEc0kaOQwbuQxc9R+FKs1 K4HS2U4uMifk0PH3dv04FBf/SAtb90RKPfOgUC+7wQ5lXBqXC4PfPLpZtYnP2uvNbDhB Z2+eCv0OyCsIt+lNfh82Vur3Q6EBcDxRv20xr+vDovzZpwuhEuqcKLwbKJqNKZphwq4f GTnBWTq+4S7eEwKBI4v4f6y9hnfc6FPRSVXM8ZEJbN8cjTL5jN8+Dvucnsnf408+P7T9 0k1g== X-Gm-Message-State: AOJu0YxlKsuOQNSwbpMoSmhitJMK4lS0Y6p0Hwjo+dBxNHQdfiw0GPqJ pAjFjG9ptowCbsOWaDEGgl/XJ92Ptg3FZwibMxCweaZZUV9o1b8b X-Google-Smtp-Source: AGHT+IFA4GtOI5DVLY0CR9h66W+OqJ3ySRkcMjVMpPQ4jAh32cn+UJ5P037C4f1Ww4qSMDoHjtOsIA== X-Received: by 2002:a05:620a:4485:b0:783:f862:88a7 with SMTP id x5-20020a05620a448500b00783f86288a7mr4466928qkp.10.1706568345431; Mon, 29 Jan 2024 14:45:45 -0800 (PST) Received: from localhost (fwdproxy-nao-013.fbsv.net. [2a03:2880:23ff:d::face:b00c]) by smtp.gmail.com with ESMTPSA id p15-20020ae9f30f000000b00783f606dcf8sm1926576qkg.73.2024.01.29.14.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 14:45:45 -0800 (PST) From: Nhat Pham To: akpm@linux-foundation.org Cc: shuah@kernel.org, hannes@cmpxchg.org, yosryahmed@google.com, tj@kernel.org, lizefan.x@bytedance.com, linux-mm@kvack.org, kernel-team@meta.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH 3/3] selftests: add test for zswapin Date: Mon, 29 Jan 2024 14:45:42 -0800 Message-Id: <20240129224542.162599-4-nphamcs@gmail.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240129224542.162599-1-nphamcs@gmail.com> References: <20240129224542.162599-1-nphamcs@gmail.com> MIME-Version: 1.0 X-Stat-Signature: h3kb8zpfttnhjkj4p8i1hx57z66wompe X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 52729A000F X-Rspam-User: X-HE-Tag: 1706568346-44712 X-HE-Meta: U2FsdGVkX1+qybOJeEPj+7TSpbSGixQ9ka+U9gc+Jg0rVpPG5QFDIjxJG0cmh3vfyufvihqpfthtlf5F23RGHXFTcxS26x46Y3JqC8iVD8yKDk9FREZC9TG7YXmdslp2kVMpLVgUVjfQU5XEBSXC8oMoKkgVYEpxGc5cs0lT8/getIhZsrg8SEyLtT96ZH8SDPRD02IIod5twoLhHwTLf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M/P2oIr8dLR3WeHI82NFRp8uBPUcfkv0shH39c5CwQ+bjfrInuJhkthHjGgDmZ8Mhgl/tK77wDnCwGJigwyiW14p0Aoiryly5ABubYJc7pf0ZMcs9Aa0Q9t9FwKldd0q98go0ZVUASKPxVTQ6m3QSq044NJySFub7Amo8R33fboB5lh0bGNyg= X-Bogosity: Ham, tests=bogofilter, spamicity=0.339968, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: We recently encountered a kernel crash on the zswapin path in our internal kernel, which went undetected because of a lack of test coverage for this path. Add a selftest to cover this code path, allocating more memories than the cgroup limit to trigger swapout/zswapout, then reading the pages back in memories several times. Also add a variant of this test that runs with zswap disabled, to verify swapin correctness as well. Suggested-by: Rik van Riel Signed-off-by: Nhat Pham --- tools/testing/selftests/cgroup/test_zswap.c | 67 ++++++++++++++++++++- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c index 32ce975b21d1..86231c86dc89 100644 --- a/tools/testing/selftests/cgroup/test_zswap.c +++ b/tools/testing/selftests/cgroup/test_zswap.c @@ -60,17 +60,39 @@ static long get_zswpout(const char *cgroup) return cg_read_key_long(cgroup, "memory.stat", "zswpout "); } -static int allocate_bytes(const char *cgroup, void *arg) +static int allocate_bytes_and_read(const char *cgroup, void *arg, bool read) { size_t size = (size_t)arg; char *mem = (char *)malloc(size); + int ret = 0; if (!mem) return -1; for (int i = 0; i < size; i += 4095) mem[i] = 'a'; + + if (read) { + /* cycle through the allocated memory to (z)swap in and out pages */ + for (int t = 0; t < 5; t++) { + for (int i = 0; i < size; i += 4095) { + if (mem[i] != 'a') + ret = -1; + } + } + } + free(mem); - return 0; + return ret; +} + +static int allocate_bytes(const char *cgroup, void *arg) +{ + return allocate_bytes_and_read(cgroup, arg, false); +} + +static int read_bytes(const char *cgroup, void *arg) +{ + return allocate_bytes_and_read(cgroup, arg, true); } static char *setup_test_group_1M(const char *root, const char *name) @@ -133,6 +155,45 @@ static int test_zswap_usage(const char *root) return ret; } +/* Simple test to verify the (z)swapin code paths */ +static int test_zswapin_size(const char *root, char *zswap_size) +{ + int ret = KSFT_FAIL; + char *test_group; + + /* Set up */ + test_group = cg_name(root, "zswapin_test"); + if (!test_group) + goto out; + if (cg_create(test_group)) + goto out; + if (cg_write(test_group, "memory.max", "8M")) + goto out; + if (cg_write(test_group, "memory.zswap.max", zswap_size)) + goto out; + + /* Allocate and read more than memory.max to trigger (z)swap in */ + if (cg_run(test_group, read_bytes, (void *)MB(32))) + goto out; + + ret = KSFT_PASS; + +out: + cg_destroy(test_group); + free(test_group); + return ret; +} + +static int test_swapin(const char *root) +{ + return test_zswapin_size(root, "0"); +} + +static int test_zswapin_no_limit(const char *root) +{ + return test_zswapin_size(root, "max"); +} + /* * When trying to store a memcg page in zswap, if the memcg hits its memory * limit in zswap, writeback should affect only the zswapped pages of that @@ -309,6 +370,8 @@ struct zswap_test { const char *name; } tests[] = { T(test_zswap_usage), + T(test_swapin), + T(test_zswapin_no_limit), T(test_no_kmem_bypass), T(test_no_invasive_cgroup_shrink), };