From nobody Sat Dec 28 21:04:26 2024 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 DB8B619D098 for ; Wed, 18 Dec 2024 11:46:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734522416; cv=none; b=LZgAT3UI4o2oy4ToPWBt8iS7Rg7FV3QTs+WKvsuBnZFzKhT8Kaghldwepr9elParmlqti2bjzfki+bcJW/egkU9ccyl2osRLC/RVmo/4rz1oNiTz1gdVAFUq4a2vgIoLhyWGcI2WhKf45vOJJXqaz2SeE+cVF4Uw45WQZYo1pEs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734522416; c=relaxed/simple; bh=pzeupsIj270sR+W/PqVPJ7qfiPRVogiciKRbC2tMwiQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FJsZA3zmG+ymDMBzgX9pj5fJNuQNrtl37rB5fe1UiptYJQODwcmoOtk7LDsVRG/UJT/q8lGogogtAdVFuDkxRHPiiVA3cmL5JOHaTs4qGZy2PgR4HWQJlBinhzasei/23uHAYy/uPehMc7rB+ESM9V3/UCeSKjtLYN/8keerm78= 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=XmLiElrz; arc=none smtp.client-ip=209.85.214.173 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="XmLiElrz" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-21654fdd5daso53350365ad.1 for ; Wed, 18 Dec 2024 03:46:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734522414; x=1735127214; 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=XXPbw4CmFZlsHQ1dqNkun8nNSKspNNgSNNzQzzqG5eQ=; b=XmLiElrz6TTqesLSn7d54r5apIeKpobOGPH/Fnac2f2h471ccTFOVKmHG/SzbBnsLc UKpSl2yxXyuwSeXlVtaHmXcacMBa8u05xiJyYhalhVRe/l66DWd4kYdsFG0ZUOA+qScS SXBsiKp/PtqkrkCum2LcNsp7Ufjva1bfT2/wEGTG4uOYdmNGhY02Jo64k/XQqm6fEQzX LrTwezpQAIKDJPE7wOgH2e7/xUlD+V68KXUlvdd2cS5huL98vOGIxv4+C33jJey2I0mR mv8BTIZaOUI0BkqkOLm7oVUTwUhzwLTm1CXjsDWZ/zAwWd+Q8OYboAEhoGwZum7XHoD1 p0UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734522414; x=1735127214; 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=XXPbw4CmFZlsHQ1dqNkun8nNSKspNNgSNNzQzzqG5eQ=; b=TZjrxNR4SmEO/4Ic6juilg8sSmGm/a2O3VT4Rmm6d5HDOnc0wSp5X9FGCe+eQ2MQWs SFe3ARuHDBtllqdIQe+EoSHMaHrjdl7SB6jFVNlK8+E906hOLVdGxUCmlV9U0Cyqyj2J CKj+EechOhvGi1KuA65ApLMF7fCM+v2NH95b0hk3vPPYHduEcDOCp6SD8alCiDPYZnt4 2hknf2Cj49sWwhD0hftYLZPOb78eZa1GyElH2gfyrFLGHA61TIi993scOLxh618pvj5i enmrro7HtvyG9foqOUv5JNrusyFqCxS7gq+mhuF205NxrTVqkG3qkQsTYM21j+7No769 VgFA== X-Forwarded-Encrypted: i=1; AJvYcCU7+6AOEbR3VRv4nc+6CALBLiMPAU6QQMyQsZVhxtT5mhd29BZOfIoe3lZ0u1hIdZxXDS0+lKxgy0EOVhw=@vger.kernel.org X-Gm-Message-State: AOJu0Yx6MKSILwMA+8blzp9046Aeh5TYb7mqY8hDnSEOBsx3YE4eXRLL 9LQcm0UyzNdDF/T6Te8Db6AsYsCTZQLgiyRbI/zxmEYHasCFunNs X-Gm-Gg: ASbGncuBm+j0eDmBzBfHK4zYRFCq7Ex6+mu1V1huCahdTTZpJgortXGl7hqx2GAHDwb JuGIUQTLBRe0N5Zb90S66V2wbtpuH377VXpXS4CfM8cNe2/Omk3pknPuRcJ+CdoMe+OscNwHoa5 kPpioUlbrsKer2gDDEuOynWF0mIgxvZLZuhrJBAAYB/D4CqP8LxYNj/4yNXUj8zz/aGtgB1umCX YVNGKR3/O1C/2Wuhn7C7vUSY4Ulbr+y3xUBiKNsVyNNBisUHkkY31sh/M4vwiECufeG/Sah5oja eCT0CmYcQw0= X-Google-Smtp-Source: AGHT+IHeEFfNZXB8eHhDobzJ6aD+/g4JcIAsmjLr3dsquieQlQtdJw7HvtuvZYuwp308/geLA7elvA== X-Received: by 2002:a17:903:2348:b0:215:9642:4d6d with SMTP id d9443c01a7336-218d6fe1d79mr29573335ad.17.1734522414061; Wed, 18 Dec 2024 03:46:54 -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.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 18 Dec 2024 03:46:53 -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 1/4] mm, memcontrol: avoid duplicated memcg enable check Date: Wed, 18 Dec 2024 19:46:30 +0800 Message-ID: <20241218114633.85196-2-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 mem_cgroup_uncharge_swap() includes a mem_cgroup_disabled() check, so the caller doesn't need to check that. Signed-off-by: Kairui Song Reviewed-by: Yosry Ahmed Reviewed-by: Roman Gushchin Acked-by: Shakeel Butt Acked-by: Chris Li --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 7b3503d12aaf..79900a486ed1 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4609,7 +4609,7 @@ void mem_cgroup_swapin_uncharge_swap(swp_entry_t entr= y, unsigned int nr_pages) * correspond 1:1 to page and swap slot lifetimes: we charge the * page to memory here, and uncharge swap when the slot is freed. */ - if (!mem_cgroup_disabled() && do_memsw_account()) { + if (do_memsw_account()) { /* * The swap entry might not get freed for a long time, * let's not wait for it. The page already received a --=20 2.47.1