Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1675638rdb; Tue, 20 Feb 2024 03:51:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVXwy6PQYdLltB3ii5FVgH+HiuzoQiX0kr2+EK44HwD9vYssh72jJvEg5bJBBK97NTw/bbuV3LH1u8pMB+BNwVzjEC8M2LchucGlHsI/g== X-Google-Smtp-Source: AGHT+IG4ruxlCFEjrXZZi838C7IFa/9ymJ64rgS1a3P29ek6wImaGBkxJBS3cM1/c5zPTkycl30o X-Received: by 2002:a05:6870:219e:b0:21e:624d:56f3 with SMTP id l30-20020a056870219e00b0021e624d56f3mr13125383oae.56.1708429864762; Tue, 20 Feb 2024 03:51:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708429864; cv=pass; d=google.com; s=arc-20160816; b=HZgO8y8gweF55d18Nu+3OUuu4Y1t0PQvdGm0pkcm/rRHLcLHVMZKlyN2gSZHYDN0wc UusMW88VuDMWMGOJ1/RRiBnkDz7kEmAWqDVV55HGfVxuinl72xd378Y0a6hqL2jrrLJd XfH45v67msTELlcpKvK4eHL/OGJOCd3lPTPE1XxpBFa1lkWSJNyJ6IzGulrB9J8ai4wx C62xajXBjMhHLTEdLvR5Q34HRPqUyWa0meLc0gpocNIWeRQGJBFlBwKxibaqbsuqNg+I DgBm7+u9B9FzijoTkFMV8+u8R0r+mZrUy02LUtzisYZBODRXx1Bf4jGbgXqMX8B/QnD+ /dQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=frGjyVgHupGD7XyoLjuBNXl6egeagHTj4tQawTxfLDk=; fh=CIhmbM3N522iZfKAx68dio1DUnYohA/38dvKjB2Sibw=; b=ZaTrvcDFZSiAkBGxo4b2RH9FbjiBpI/ZbbGII4DI8yPPFrrjc5y6HnFcSupLiN3w2l g3hqOkZDtFe6bYYIIzqhimVU86fpY2q9imeUvcsgnJQmhpBea3HQdzdW+tkkrbhjVqJd 1FuO2/OebcE99jUrV/UFB8qNJDRn/kAcA9Eyu+Je4eiX2CGfoy24iW1SgKdX5B/EaEfe 3+Ot3WOXVB4fJLVwaDJTa2T3CZfOCrAnz5bfwiecpcXy/p6QBp0OwK1H+A7J7y3ESuha KcrLa1eyAXyy4kM8arG3pBAnZGElXSIGqv0K6qLfSYNKzYlRmmXD5KLJFLFn+UgcNf29 Awfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=g0nQyEhc; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-72931-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72931-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id o26-20020a63731a000000b005ce3cd4ed95si6183528pgc.94.2024.02.20.03.51.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 03:51:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72931-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=g0nQyEhc; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-72931-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72931-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C7B25B23A11 for ; Tue, 20 Feb 2024 11:45:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2865567C69; Tue, 20 Feb 2024 11:44:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="g0nQyEhc" Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [95.215.58.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E2FB67A17 for ; Tue, 20 Feb 2024 11:44:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708429486; cv=none; b=VurmfXDYNqtW2V41oi9gokSJPKzf8Vj/wuXjKW0aaep3ucnCK6vBaoYzMtvzWxMRIamDyr0dr4HVeI5SQ/W/eE8nQ9bNpH6uR1zed4YYWvYVEmTw6QQupQ0pzz80oaP5up5yPNxHwQac1ebDqdWpQO8baE7hgi1ORj+/2TC5Eyo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708429486; c=relaxed/simple; bh=BFuh+CfNDOzD1S00lsGqAqSSiu2o1MPg0aixlXGfmos=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V8nLM7uMa30viyjX1cqaCIWpunU2mX+KDLcm05XJAZ5FuAnhQtGkvX/mocAaSp0uqSq5/SemC+t4TBfwnc2eyN6PUOfHHnLfr4C259BaCgJDO1ktBfu6S+/GEUPzR9G1zooI1tgAkb+lkz3oVeCIig2QDl8vxjpFl10VZ6a0C2E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=g0nQyEhc; arc=none smtp.client-ip=95.215.58.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1708429482; h=from:from: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:in-reply-to:references:references; bh=frGjyVgHupGD7XyoLjuBNXl6egeagHTj4tQawTxfLDk=; b=g0nQyEhc0uv+uyH42ziPQ1j9bhr8hQRZCCD1pT3uRaE0h01LgIKi7xFEjBfKNbh47w5tba emvlznq1s+LOnT3Lw9TXWIogMbzkBgFeeOLy8fgJ2ioyd72Q8p+oL3w56Dqvf7WbgzC07F xS30vIqd5dGOK4fSMvu6DsMCjzJH//c= From: Chengming Zhou Date: Tue, 20 Feb 2024 11:44:30 +0000 Subject: [PATCH RESEND 2/3] mm/zsmalloc: remove_zspage() don't need fullness parameter Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240220-b4-zsmalloc-cleanup-v1-2-b7e9cbab9541@linux.dev> References: <20240220-b4-zsmalloc-cleanup-v1-0-b7e9cbab9541@linux.dev> In-Reply-To: <20240220-b4-zsmalloc-cleanup-v1-0-b7e9cbab9541@linux.dev> To: hannes@cmpxchg.org, Andrew Morton , Sergey Senozhatsky , nphamcs@gmail.com, yosryahmed@google.com, Minchan Kim Cc: linux-mm@kvack.org, Chengming Zhou , linux-kernel@vger.kernel.org X-Developer-Signature: v=1; a=ed25519-sha256; t=1708429476; l=2152; i=chengming.zhou@linux.dev; s=20240220; h=from:subject:message-id; bh=GQWspwGCFRIlLWu+jB/4L2Vh7hNigRDA/nhdzUelvTs=; b=HfKohdQBHsp+yH25vS97QDG5EljLYcLDRXNqctQwnwKj01ORLuWu4tU2UdBSKwG84P3sebhh0 +EDf/e7QoXHDzKOZQ3ztPMFYVZxHPOhdOxb/wSKcAv5ObGPWQggBTCa X-Developer-Key: i=chengming.zhou@linux.dev; a=ed25519; pk=5+68Wfci+T30FoQos5RH+hfToF6SlC+S9LMPSPBFWuw= X-Migadu-Flow: FLOW_OUT From: Chengming Zhou We must remove_zspage() from its current fullness list, then use insert_zspage() to update its fullness and insert to new fullness list. Obviously, remove_zspage() doesn't need the fullness parameter. Signed-off-by: Chengming Zhou --- mm/zsmalloc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index a6653915bf17..c39fac9361d7 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -687,10 +687,10 @@ static void insert_zspage(struct size_class *class, * This function removes the given zspage from the freelist identified * by . */ -static void remove_zspage(struct size_class *class, - struct zspage *zspage, - int fullness) +static void remove_zspage(struct size_class *class, struct zspage *zspage) { + int fullness = zspage->fullness; + VM_BUG_ON(list_empty(&class->fullness_list[fullness])); list_del_init(&zspage->list); @@ -716,7 +716,7 @@ static int fix_fullness_group(struct size_class *class, struct zspage *zspage) if (newfg == currfg) goto out; - remove_zspage(class, zspage, currfg); + remove_zspage(class, zspage); insert_zspage(class, zspage, newfg); out: return newfg; @@ -878,7 +878,7 @@ static void free_zspage(struct zs_pool *pool, struct size_class *class, return; } - remove_zspage(class, zspage, ZS_INUSE_RATIO_0); + remove_zspage(class, zspage); __free_zspage(pool, class, zspage); } @@ -1609,7 +1609,7 @@ static struct zspage *isolate_src_zspage(struct size_class *class) zspage = list_first_entry_or_null(&class->fullness_list[fg], struct zspage, list); if (zspage) { - remove_zspage(class, zspage, fg); + remove_zspage(class, zspage); return zspage; } } @@ -1626,7 +1626,7 @@ static struct zspage *isolate_dst_zspage(struct size_class *class) zspage = list_first_entry_or_null(&class->fullness_list[fg], struct zspage, list); if (zspage) { - remove_zspage(class, zspage, fg); + remove_zspage(class, zspage); return zspage; } } -- b4 0.10.1