From patchwork Mon Apr 17 05:01:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 13213251 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 528E2C77B61 for ; Mon, 17 Apr 2023 05:01:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 90B978E0002; Mon, 17 Apr 2023 01:01:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 894948E0001; Mon, 17 Apr 2023 01:01:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 735508E0002; Mon, 17 Apr 2023 01:01:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5F3668E0001 for ; Mon, 17 Apr 2023 01:01:55 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D2DD21203D1 for ; Mon, 17 Apr 2023 05:01:54 +0000 (UTC) X-FDA: 80689685748.13.5D8CBA0 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf04.hostedemail.com (Postfix) with ESMTP id EEA9140014 for ; Mon, 17 Apr 2023 05:01:52 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=HzynEqYH; spf=pass (imf04.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.214.178 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681707713; a=rsa-sha256; cv=none; b=uN48aHtGKf9PBLp1YDsa+RD9N7cDCLq8XyaBlDcMwwGyIR7PBINdpUZX5dr4b0jXqygpPV DDpgVfBOsGIfqrfT8Ni2oRHLf6FL7WH+1gmZKhHZT2Sda2ChLlrtl4wemoNXLSvtiTX2Jk RQXe2eaEClyzZ9WPUwv5FWArxrebSPI= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=HzynEqYH; spf=pass (imf04.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.214.178 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681707713; 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=bS4Pkg0HE5+UxYA0hiruUQ00ilsEPgdYXH5UV1O8hIk=; b=timAiGiuDh48V2Al2z6LHrgQnZIYzTWhkSmBwlN9vYUrqMRNoogpwQA0uEw5j5edEYD6wx djYHUNl+33WqvD7c1+p3ncY/8AP/JDxUSbkZbjIBbXre2SNhIf5h+2yTPIoCdizJSykJhc a6WkabiAxI6mF5c0GyO51XLWjShbiDI= Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1a516fb6523so18248515ad.3 for ; Sun, 16 Apr 2023 22:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1681707711; x=1684299711; 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=bS4Pkg0HE5+UxYA0hiruUQ00ilsEPgdYXH5UV1O8hIk=; b=HzynEqYHkWXVtxmpOKeHNyA59TmKbC48BgADQgAoicyyonNQRXqBtqety7oevIB4mO kWKoXOGUb43q9ItRNjf2w/tVUpztvMbeF/eCrjFRlTI/ywnZR+UYUGr9q22sca3LhHsf ASX7P+o6OaOaL52hSvqJvffIalsVnc2QJSpW8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681707711; x=1684299711; 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=bS4Pkg0HE5+UxYA0hiruUQ00ilsEPgdYXH5UV1O8hIk=; b=h5p2jVcGMmKvC/d9zN1NpFH4gqeIc7JALJFPe3xpolpAxnQ9cHNLH4DpVn7Wx5HtMg lUbCl7X7SDBBLhHDHdmXRCKBMd2UuOdXIDtme+PVFxfKTkW484WYBcD+QN0/HAoE1aX7 oBia61R/JKaLNZVwYAzX2dN/7adVcJ6COmJItDHD74KMP/eaVpF2aN/XP6hdwvIwACJS Q1JrgU4XPrUrbxqesD4LNZEq/eLRlVopgci4181rgdMlaAXsa/EvTPtLYuaoxqVnDx1q YspXZNvS1+Nw9S21U15IE0cBq1MRNjGpI5UzucXHiaIY9PQuZb1EYk6jXQ1eIoylZ78e iBVA== X-Gm-Message-State: AAQBX9exhX57d1diJnlbZPd4KInJybpy7716MMTY/QL8+aA955rAOVmP Ls/7iBhrTlws/2vxmbzwR2FE3w== X-Google-Smtp-Source: AKy350bQ2D/xaVVJ692Azw6bLaxA+WF72DQHClmy0RxhD6f3549DDpfcBdeZ78HRBvLYvTirNl7gSw== X-Received: by 2002:a05:6a00:23c8:b0:623:e4d2:d13e with SMTP id g8-20020a056a0023c800b00623e4d2d13emr21214550pfc.34.1681707711595; Sun, 16 Apr 2023 22:01:51 -0700 (PDT) Received: from tigerii.tok.corp.google.com ([2401:fa00:8f:203:97ac:e7c:d412:5251]) by smtp.gmail.com with ESMTPSA id p15-20020aa7860f000000b005810c4286d6sm6661977pfn.0.2023.04.16.22.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Apr 2023 22:01:51 -0700 (PDT) From: Sergey Senozhatsky To: Andrew Morton Cc: Yu Zhao , Minchan Kim , Yosry Ahmed , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Sergey Senozhatsky Subject: [PATCH] zsmalloc: reset compaction source zspage pointer after putback_zspage() Date: Mon, 17 Apr 2023 14:01:40 +0900 Message-ID: <20230417050140.1653593-1-senozhatsky@chromium.org> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog In-Reply-To: <20230304034835.2082479-4-senozhatsky@chromium.org> References: <20230304034835.2082479-4-senozhatsky@chromium.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: EEA9140014 X-Rspamd-Server: rspam01 X-Stat-Signature: 19myaoo6fkctuxuzxu65mcqtu56oxmei X-HE-Tag: 1681707712-470711 X-HE-Meta: U2FsdGVkX18YSc/HSQyimg1JI+sPHANdqYx/47GSl923UIbtaJRQhhRnOH2qEu1o1edsj3AfQfNulwEsRWI1yZK1gOnSYBtlZH+LR2bjPXqrinYvo0N3KLYQCC4xUMNrfYpwoXEkUamy9dPxRwcey0g+/GXjuoI1fCsm07OXv/kWKD7pmIeiJiIg77ZzGnhjtDZP4cux/MjTzfAGOHLBMlEoRossdIp5mDfbXH3jwGJK7SlMGzGVZrhgsjuv79ja4pxBrgwmE5SFx1JX/MtRBcyGPZZ5gURqm1pAvog1ZHbTx/DoWM8MV45NH8vtqYtH9S5Y3fGL9+vf23V78C9CDB4u/RljHoY3RcTcbYhgET5XmMR7AFVIsidD1Q0tHJlrkBrz50Caw2zRW7MvDXxBODlEzSGOXEe6px6URP497XOknHmEqVshRkJt2+R9xzuQg4kikDApbg8iZnGLGqIsrQQji46azN/8pGND17WVbFpvhXXyo1v2Gghsy6WsREGbysAnc6KJLjBAPM2E7yGnSS/z0jq+wdRsmHjv8otocBB+yxS97cYcuapwWo7MzAkhHODiYEu5o+XPi7gowYDaQmThMYRs2GBHlEwEXfXtZXARRGAv6mlSOVif5QfqCqhgzMAFn72gBQ8AYEd0Aa0btRg48s0MavHxw8Y4CDytu/xfPF+0o2Ds7Utew1bQvdDJCvW16Qzw4KSob+LyLl9siE4ZJUL8cnxBkRictE8PXp5MNhGT/iliOXbeV8+1nHmnwR7+t/fhGkyl7/K5+coPCu03g/8kUygZgCjqWQLuMTdgo2dEPoZi2GrNzfSXlvljWBrndGW/KLS592VEv7z9aKAfVWiIXwz/5nch1VZXdz4/Csk+467d8FOZohSGFhy9gTFquQQtRW3zpe1RHn+4v6OrWCvII240TvxDwzUF+c/FkxaubA5zyNSaSV9ny9lrEjiKnl2KbJD1Xj9Rm6Y y4ID4wow rlY93gvZS80tRLS+CqNHEYWEKt+SLHZ+c7AEwoDZqrw405rW6ohYUTK7GunUtzXzkSG+AghVl8VGAVIClWgmqhhSfWbgSFHT0ih1iYzFoapQ72Xs99Z23ca54Yn7oHFKgrGN1o290W35q3Ez1wu4cXXB0/rzVYbicXsI5nkcpbMGtb1/58OL7DX3AldbuHLdZriLk4Q8+6UrjFdVbrAfxoiQf66FsIiYhTbfdp3g2khqgabgfWIGtHYwW0VIwyOBTnhGntuASxOJSo4NmnR89gWTBe7HlcDhW2hheL3WINfTBPQvMd7QtS9R5MJAmmYXTUyzp9al1D41T5OJRUW+L5J4p2Tr7D89wwuxWz0DdBEem7Ag5HelOxD+4siI783LDx2EgAoWQM/Ak+qAMe2n2nkAnaslQT5DLDr3/okRKcwlT90BVjjtIHSA+AHbO3z5GPXpF8dc64mpeMVY3AxTe17UZ6Wh3SWH+7AvIFl1KWxuleN1+XnOSR/Em2Q== 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: Fixup. Reported-by: Yu Zhao Signed-off-by: Sergey Senozhatsky Tested-by: Yu Zhao Reviewed-by: Yosry Ahmed --- mm/zsmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index aea50e2aa350..cc81dfba05a0 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -2239,8 +2239,8 @@ static unsigned long __zs_compact(struct zs_pool *pool, if (fg == ZS_INUSE_RATIO_0) { free_zspage(pool, class, src_zspage); pages_freed += class->pages_per_zspage; - src_zspage = NULL; } + src_zspage = NULL; if (get_fullness_group(class, dst_zspage) == ZS_INUSE_RATIO_100 || spin_is_contended(&pool->lock)) {