Message ID | 20231213-zswap-dstmem-v1-0-896763369d04@bytedance.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 4117EC4332F for <linux-mm@archiver.kernel.org>; Wed, 13 Dec 2023 04:18:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A8F666B043C; Tue, 12 Dec 2023 23:18:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A3F796B043D; Tue, 12 Dec 2023 23:18:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 955876B043E; Tue, 12 Dec 2023 23:18:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 8851A6B043C for <linux-mm@kvack.org>; Tue, 12 Dec 2023 23:18:22 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 55BFD140B41 for <linux-mm@kvack.org>; Wed, 13 Dec 2023 04:18:22 +0000 (UTC) X-FDA: 81560488044.25.2CB7F83 Received: from out-175.mta0.migadu.com (out-175.mta0.migadu.com [91.218.175.175]) by imf01.hostedemail.com (Postfix) with ESMTP id 014A640019 for <linux-mm@kvack.org>; Wed, 13 Dec 2023 04:18:19 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine); spf=pass (imf01.hostedemail.com: domain of chengming.zhou@linux.dev designates 91.218.175.175 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702441100; a=rsa-sha256; cv=none; b=i4/fi2icV4LkKVAH8i4K/A7NFBvso0Hv54dIz0d2pj6eKmsIsCXrhgdNFQQAPddmASiQSn xkyzGZPj2lC1cxriPoBVhfFcegN/yD02sC3gGkSY11iDgsPFqJqpV9/ls4sNhkwcZIFPA9 hKoSZj49z+amhDZME3QLIisJemhRS4Y= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine); spf=pass (imf01.hostedemail.com: domain of chengming.zhou@linux.dev designates 91.218.175.175 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702441100; 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-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=qstfiQ4EYIQh5helYKNgHGZm0OFS5VngQH8plvY6kSI=; b=WmjAjRweIn/s2UNmN9jCv1ZNxAPg83G+IPt3SxafZq0RmcFi6P/PjllvkCzMLfmB7f9yWD fQ0phBBc0u2KzXM75gyHGa/XI7ybF0BM2ItKaUb0t2Ad6fpoBjRcXV5gWc//VH+A69yXo6 f7bw22oobaN2Q8OteavbccXq3Kcwn9o= Subject: [PATCH 0/5] mm/zswap: dstmem reuse optimizations and cleanups MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-b4-tracking: H4sIAHUweWUC/w3LSQqAMAwAwK9IzgZsgyL+pku0Ba3SuIDSv9vjHOYD4RxZYGo+yHxHiXuqUG0DLp i0MEZfDbrTpLQifOUxB3o5N97Qj3qc+4GoIw+1WCOMNpvkQk3pWtdSfqkk0JBjAAAA X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou <zhouchengming@bytedance.com> Date: Wed, 13 Dec 2023 04:17:57 +0000 Message-Id: <20231213-zswap-dstmem-v1-0-896763369d04@bytedance.com> To: Andrew Morton <akpm@linux-foundation.org>, Nhat Pham <nphamcs@gmail.com>, Chris Li <chriscli@google.com>, Johannes Weiner <hannes@cmpxchg.org>, Seth Jennings <sjenning@redhat.com>, Dan Streetman <ddstreet@ieee.org>, Vitaly Wool <vitaly.wool@konsulko.com>, Yosry Ahmed <yosryahmed@google.com> Cc: Nhat Pham <nphamcs@gmail.com>, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Chengming Zhou <zhouchengming@bytedance.com> X-Developer-Signature: v=1; a=ed25519-sha256; t=1702441093; l=1265; i=zhouchengming@bytedance.com; s=20231204; h=from:subject:message-id; bh=4N/N3d6vf4Cr8tlyMdsv58l39FdZR4xTSa4G2vw01Tw=; b=1H0ZW0s0yYdhJDk8Es+apfTEC49Edv/TqZq9k2TzSK0aD8m5foU+riuo2CXYcYDjsAgQ/8ByF zBPo/uKizNyBUejluXNo+6s313o5t3iTXcbL5qro6LEOgIRKmJk29cE X-Developer-Key: i=zhouchengming@bytedance.com; a=ed25519; pk=xFTmRtMG3vELGJBUiml7OYNdM393WOMv0iWWeQEVVdA= X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 014A640019 X-Stat-Signature: 17abdhethb8ifb96upws46fpgjkstx3w X-Rspamd-Pre-Result: action=add header; module=dmarc; Action set by DMARC X-Rspam-User: X-Rspam: Yes X-HE-Tag: 1702441099-256655 X-HE-Meta: U2FsdGVkX1/k7Sil9T9cCXJglfF93HOjxz8wevNUjRkO/+mJXcWXW5UTwClErcRZCzXwTusnhFa6w5+3SJKiz5la2gdou+cKyntgywms/lDG16tv4ccfdjvxefj2DLQn/ws5IMimy7D+6wYLT5RnSUhd470pXRRG4HK04TCqNki+ubZVoHpMuSWK3ULvH9nJuQzyKdNDNsUEoW3t3mEapuyQjTyRlAXA7W51YduSp1KGDlQFPVpoDfl0SItnKy1ML7WE61/el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wiiRliCbrIyzBbmucGlpPSs/Or4mWvprAjVURrNE41c= 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm/zswap: dstmem reuse optimizations and cleanups
|
expand
|
Hi everyone, This series is split from [1] to only include zswap dstmem reuse optimizations and cleanups, the other part of rbtree breakdown will be deferred to retest after the rbtree converted to xarray. And the problem this series tries to optimize is that zswap_load() and zswap_writeback_entry() have to malloc a temporary memory to support !zpool_can_sleep_mapped(). We can avoid it by reusing the percpu crypto_acomp_ctx->dstmem, which is also used by zswap_store() and protected by the same percpu crypto_acomp_ctx->mutex. [1] https://lore.kernel.org/all/20231206-zswap-lock-optimize-v1-0-e25b059f9c3a@bytedance.com/ Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com> --- Chengming Zhou (5): mm/zswap: reuse dstmem when decompress mm/zswap: change dstmem size to one page mm/zswap: refactor out __zswap_load() mm/zswap: cleanup zswap_load() mm/zswap: cleanup zswap_reclaim_entry() mm/zswap.c | 158 +++++++++++++++++++------------------------------------------ 1 file changed, 49 insertions(+), 109 deletions(-) --- base-commit: 1f242c1964cf9b8d663a2fd72159b296205a8126 change-id: 20231213-zswap-dstmem-d828f563303d Best regards,