From nobody Sat Dec 28 22:04:40 2024 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 771F21AA1D1 for ; Wed, 18 Dec 2024 11:46:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734522419; cv=none; b=apGHgecJvZCRUXIDaS+V6+51NBp+6m+gqiRwb8uT7w7fyrdpuUXJg8UbwXqHbtGJ/eEfuAltZXDkFDpYrTKi+PaLzQJPrLw3FgycwpWMXvCE+fpFJnOyfiPMIyRgSe+0SEC9ANaQX6MVBR1nT69d6+y9Y0oOk5o7KGw0PFWYOCk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734522419; c=relaxed/simple; bh=hOZ5NlNngeRjH8z8G2TqenUNXh7uBbdu8kbCPeD0Q80=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OROIZY9tJp67yTuo/WdfDqRmF8BNvGZT48uJW7wV7HXxUZJY2ocHcuTkKz6YYlCTMKLMLpHHy/nucrjjQpt95MYv9NM5VhL2YkIAbqzir72WL8RhPsWINcREfXjp2OtpDkPA7P52nyVZA7FxrdmUJxV7vE7N5E1uo9a5OCcd4b0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JQMXYgp3; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JQMXYgp3" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-21644aca3a0so75550845ad.3 for ; Wed, 18 Dec 2024 03:46:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734522418; x=1735127218; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=BSCLGHYqLWfZbOCM52YJejtZzzMrW+w4kb+fWMx8dAg=; b=JQMXYgp3eoebul49Mf7+Y0x28nz+zA4SjsYH3CGrtRE99c/3RqLfYZULANSd1jQFRt aaZKEnSGQRa7eMNv1t/UgHtIrh7g4NOxHILznFo5ceeZ7djSQ4kbcHRn1OzHckcVzSYR SE+KTNdk3ID3Aeo9sOyA5wxtGI5O9gkm4+5GqkH9FXL1hrK3bJfTmNhgGLC0m+hWbfrK pRTEtYIepKG8UY5lATaue0Vm7X4X0j+b2+zZSa75Vk7/ygt9I7lxPYDdN4FQXQaWwpWx PfZTmqfPsmmybp1tb6fdkYrHhZconf+v8WgVdhqe1c6RXIDkIgAetQmShBNR9yCBHXXQ qCWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734522418; x=1735127218; h=content-transfer-encoding:mime-version:reply-to: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=BSCLGHYqLWfZbOCM52YJejtZzzMrW+w4kb+fWMx8dAg=; b=fYoARxSODb8jTG/cGWbenYxqFsxlNqDZVhe8I85UtYgAq9OB+UqIMrx/5uV1vHulXF F0NwEklE8Lz+GaLK3J3BZhEj+iVRz0VaG+wvAhbW5JcjzlvbIAOiPWkdBob1W3VD4nvd cju46nd7jaC6Hn8B6tVjR8Q+US1fFyVk0IhA2krtDM6tF/mY2CjmEDe7DnTrEPdmiL1W KcRghTHZaWiwBUPpL4+V6MdbQL4/2HEBIW9YGd6d+N4R7jcFT6jowdfs1zrI6N6jma46 Lig2Xzs/lvB5ZgEowxvuwXnf9/e9/u4VEmVSwhUJNe1Ml2svRTsTy1PjFOT0tbunMlPA GpGw== X-Forwarded-Encrypted: i=1; AJvYcCWu2eqE7re3oShyiGMQ5HvOjMTUaAo8re3Ls3nLm77BzD2Ok3dpc2z0piY+vRsuX/hidUYEjs4hU0WLHPo=@vger.kernel.org X-Gm-Message-State: AOJu0YzNHoPLZ604b2aWt7GFRyflNxYo+hl3hixo4aQ3IcmULeFN/+Uo FV9Kt74Zx0Sql6b5VWjfnHJLfRAjJ1e+jTKvdlmdcmZRm9emAt10 X-Gm-Gg: ASbGncuWYb6BV7zu3wE8Cg4x25jB1yxcnTocOdPZ2FxCq+EycTqHI3hTFQdTxE9cePw skumpIqPUYy3U37W+Y740e6D4LRgbs8d+B4hb9DQqqsmQ3isC57tfi+nZaNQR7rTLWBeNXTw5Mz FmhobazS767JjvImLZQIMGFb7ETNMDjN1Nhx4q1mazdd4pOmlFpxKxrdug2ZU4kYwxIm3kZeHzx aH9cESJtUK7L7GPsiX6K+vr4Yk0XokEJlkLWyhEhn2cVIIz0IVXPKcprkiGKbfioO3w3G9ithJv 5WsrJICWPZ4= X-Google-Smtp-Source: AGHT+IFDiEO8Z+4jJiOJGyVQCnx8m44fCY5Sa4Cm3pyPpkeXJ0qEbZhG2rc7F1TYGzL+U0+D2iRi5w== X-Received: by 2002:a17:90b:2745:b0:2ee:8ea0:6b9c with SMTP id 98e67ed59e1d1-2f2e91d7dddmr4670423a91.12.1734522417699; Wed, 18 Dec 2024 03:46:57 -0800 (PST) Received: from KASONG-MC4.tencent.com ([43.132.141.21]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1db7f50sm74337285ad.39.2024.12.18.03.46.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 18 Dec 2024 03:46:57 -0800 (PST) From: Kairui Song To: linux-mm@kvack.org Cc: Andrew Morton , Chris Li , Hugh Dickins , "Huang, Ying" , Yosry Ahmed , Roman Gushchin , Shakeel Butt , Johannes Weiner , Barry Song , Michal Hocko , linux-kernel@vger.kernel.org, Kairui Song Subject: [PATCH v3 2/4] mm/swap_cgroup: remove swap_cgroup_cmpxchg Date: Wed, 18 Dec 2024 19:46:31 +0800 Message-ID: <20241218114633.85196-3-ryncsn@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241218114633.85196-1-ryncsn@gmail.com> References: <20241218114633.85196-1-ryncsn@gmail.com> Reply-To: Kairui Song Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kairui Song This function is never used after commit 6b611388b626 ("memcg-v1: remove charge move code"). Signed-off-by: Kairui Song Reviewed-by: Yosry Ahmed Reviewed-by: Roman Gushchin Acked-by: Shakeel Butt Acked-by: Chris Li --- include/linux/swap_cgroup.h | 2 -- mm/swap_cgroup.c | 29 ----------------------------- 2 files changed, 31 deletions(-) diff --git a/include/linux/swap_cgroup.h b/include/linux/swap_cgroup.h index ae73a87775b3..d521ad1c4164 100644 --- a/include/linux/swap_cgroup.h +++ b/include/linux/swap_cgroup.h @@ -6,8 +6,6 @@ =20 #if defined(CONFIG_MEMCG) && defined(CONFIG_SWAP) =20 -extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent, - unsigned short old, unsigned short new); extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short i= d, unsigned int nr_ents); extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent); diff --git a/mm/swap_cgroup.c b/mm/swap_cgroup.c index f63d1aa072a1..1770b076f6b7 100644 --- a/mm/swap_cgroup.c +++ b/mm/swap_cgroup.c @@ -45,35 +45,6 @@ static struct swap_cgroup *lookup_swap_cgroup(swp_entry_= t ent, return &ctrl->map[offset]; } =20 -/** - * swap_cgroup_cmpxchg - cmpxchg mem_cgroup's id for this swp_entry. - * @ent: swap entry to be cmpxchged - * @old: old id - * @new: new id - * - * Returns old id at success, 0 at failure. - * (There is no mem_cgroup using 0 as its id) - */ -unsigned short swap_cgroup_cmpxchg(swp_entry_t ent, - unsigned short old, unsigned short new) -{ - struct swap_cgroup_ctrl *ctrl; - struct swap_cgroup *sc; - unsigned long flags; - unsigned short retval; - - sc =3D lookup_swap_cgroup(ent, &ctrl); - - spin_lock_irqsave(&ctrl->lock, flags); - retval =3D sc->id; - if (retval =3D=3D old) - sc->id =3D new; - else - retval =3D 0; - spin_unlock_irqrestore(&ctrl->lock, flags); - return retval; -} - /** * swap_cgroup_record - record mem_cgroup for a set of swap entries * @ent: the first swap entry to be recorded into --=20 2.47.1