From nobody Sun Nov 24 13:22:59 2024 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 26BA11FCC78 for ; Mon, 4 Nov 2024 22:28:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730759287; cv=none; b=k5E+NGVfph1VHZoUy2T8bGCoWtrJ4TKuzGUfj2od0TgE1dJW0ZBb+3MQW1cPWX8sGlyzwSJx3Kz/Y+DDAewhUvDUiHSbX7KNOPgPPhZvBpskU1Xi6o1Pd1I4iPwk/FzLaq7HsC70vlaBi/il1ZfSTvSwyaXE0WEwHLmg/jXHwkc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730759287; c=relaxed/simple; bh=EJNvneSb2bAkEoIP2yqDhFgTFWhaaoBBZ0be+xlgRAs=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=XVxnkjWQfC69UoXOPUDlHls2OJKMpJneOGPS/utFp8MwZH3ZdZcifbhODyYxLaqoLyvQDFMMYNfi5QVbEqM11cATCbjAfO87pxREFRxlSSSmxSHBxMyQj8KyhoNwEtktDXlAtLK9boO3nWQjDaEaYvaoYRynXR5Bk+YrJFu1cFo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--kerensun.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=i5xkWc2j; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--kerensun.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="i5xkWc2j" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e3314237b86so3942389276.1 for ; Mon, 04 Nov 2024 14:28:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1730759285; x=1731364085; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=9Y1rurBWlXkBJ5QujXdpx9YV8mvueM8qn9kB2Iz3Dps=; b=i5xkWc2jukm6ne3EuLkiOI0dfJdRnGUSnC7YI2qgwhSua3373O08QqycRpRYEoFZnH hvyJhmDrrV8E0gqslY6cThTer9rZGAVHlB0OiGtsbbyB5gfzOhRCeU6rZHRgs9RKr+2y JY/K4uaYfN5aM/gXHVIp0hlIPgiweUp20Xic2mK7mxfO8PkLj+fjEhRZyDlZaTjcPFdj rFwWUd7BE+7kTi7C585JW8ohr1w0+ca6tof5WCSP1DOBMZjhg367pwxAwZPX7kz3bB2D Of+467RwbgZ6liKw1d8Lz64StppoL6/W/41M2Sv9Qq12Gq6AZB+VtebS711FzH+0nnjq EbqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730759285; x=1731364085; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9Y1rurBWlXkBJ5QujXdpx9YV8mvueM8qn9kB2Iz3Dps=; b=JRAjQUxJGNlZblz8w896N28nbQ9XMIkkR+SRkfqkmrnTue2AJ5shDimvwpo/lvYuML NUaSVtXgSY7pDkcgSPiP7TMLjK75R0Aa+L6dXFKfneFOWszHhXGUBHVESFE1CDoMbStn BllqCEZrTftNePGKNb4xibvBctL0pXK6KRwKf/Q12wrh0c/01wdW9+ZSNwIFsUll3jts wMfS0UssKZk55ROkcoMCWvwMIl9ji8TAahDynngSbXDfYYuV5UVwzFFArIgHDLOmuVLw xxKJH+Xnupt1JR5Qh6Ol3c65kLQOV2QmYEK1mPbzoWF3Ip0w+hNaVN1WhcWAstEKN0V8 rLtw== X-Forwarded-Encrypted: i=1; AJvYcCWR30zpFqwuIfD1OIMN5ucbv6EDZr1dVZyJGis35xUbbogQJfG/oBePk4XyLovMd9+0+Gf7rmcrlYaHEPM=@vger.kernel.org X-Gm-Message-State: AOJu0Ywg80rUZV0Vyv7uzJS2RdizGrHdC6cFFZSreD5Ee0TvBFNrSnY5 4qXSs8Jcr82+VKoCOetsgmWL6ksPDlpkPEzgb5Azzb+L0JTPijwpFQZ+qnerMIYrvLkQl0qIse9 z2Ee53vbuPA== X-Google-Smtp-Source: AGHT+IFYKOaIjpS8Fz6C5WIVgYJMz0Emr23R1GgYJzZPyhN+IxJ95BqWZNBsDFRPvDl3JbnLJUB3ze0a9JPbmw== X-Received: from kerensun.svl.corp.google.com ([2620:15c:2c5:11:2520:b863:90ba:85bc]) (user=kerensun job=sendgmr) by 2002:a25:b324:0:b0:e1c:ed3d:7bb7 with SMTP id 3f1490d57ef6-e330253c596mr9576276.1.1730759285167; Mon, 04 Nov 2024 14:28:05 -0800 (PST) Date: Mon, 4 Nov 2024 14:27:34 -0800 In-Reply-To: <20241104222737.298130-1-kerensun@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241104222737.298130-1-kerensun@google.com> X-Mailer: git-send-email 2.47.0.199.ga7371fff76-goog Message-ID: <20241104222737.298130-2-kerensun@google.com> Subject: [PATCH 1/4] mm: fix quoted strings spliting across lines From: Keren Sun To: akpm@linux-foundation.org Cc: roman.gushchin@linux.dev, hannes@cmpxchg.org, mhocko@kernel.org, shakeel.butt@linux.dev, muchun.song@linux.dev, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Keren Sun Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This patch fixes quoted strings splitting across lines in pr_warn_once() by putting them into one line. Signed-off-by: Keren Sun --- mm/memcontrol-v1.c | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index 81d8819f13cd..3951538bd73f 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -602,9 +602,7 @@ static int mem_cgroup_move_charge_write(struct cgroup_s= ubsys_state *css, { struct mem_cgroup *memcg =3D mem_cgroup_from_css(css); =20 - pr_warn_once("Cgroup memory moving (move_charge_at_immigrate) is deprecat= ed. " - "Please report your usecase to linux-mm@kvack.org if you " - "depend on this functionality.\n"); + pr_warn_once("Cgroup memory moving (move_charge_at_immigrate) is deprecat= ed. Please report your usecase to linux-mm@kvack.org if you depend on this = functionality.\n"); =20 if (val & ~MOVE_MASK) return -EINVAL; @@ -1994,15 +1992,11 @@ static ssize_t memcg_write_event_control(struct ker= nfs_open_file *of, event->register_event =3D mem_cgroup_usage_register_event; event->unregister_event =3D mem_cgroup_usage_unregister_event; } else if (!strcmp(name, "memory.oom_control")) { - pr_warn_once("oom_control is deprecated and will be removed. " - "Please report your usecase to linux-mm-@kvack.org" - " if you depend on this functionality. \n"); + pr_warn_once("oom_control is deprecated and will be removed. Please repo= rt your usecase to linux-mm-@kvack.org if you depend on this functionality.= \n"); event->register_event =3D mem_cgroup_oom_register_event; event->unregister_event =3D mem_cgroup_oom_unregister_event; } else if (!strcmp(name, "memory.pressure_level")) { - pr_warn_once("pressure_level is deprecated and will be removed. " - "Please report your usecase to linux-mm-@kvack.org " - "if you depend on this functionality. \n"); + pr_warn_once("pressure_level is deprecated and will be removed. Please r= eport your usecase to linux-mm-@kvack.org if you depend on this functionali= ty.\n"); event->register_event =3D vmpressure_register_event; event->unregister_event =3D vmpressure_unregister_event; } else if (!strcmp(name, "memory.memsw.usage_in_bytes")) { @@ -2408,9 +2402,7 @@ static int mem_cgroup_hierarchy_write(struct cgroup_s= ubsys_state *css, if (val =3D=3D 1) return 0; =20 - pr_warn_once("Non-hierarchical mode is deprecated. " - "Please report your usecase to linux-mm@kvack.org if you " - "depend on this functionality.\n"); + pr_warn_once("Non-hierarchical mode is deprecated. Please report your use= case to linux-mm@kvack.org if you depend on this functionality.\n"); =20 return -EINVAL; } @@ -2533,16 +2525,11 @@ static ssize_t mem_cgroup_write(struct kernfs_open_= file *of, ret =3D mem_cgroup_resize_max(memcg, nr_pages, true); break; case _KMEM: - pr_warn_once("kmem.limit_in_bytes is deprecated and will be removed. " - "Writing any value to this file has no effect. " - "Please report your usecase to linux-mm@kvack.org if you " - "depend on this functionality.\n"); + pr_warn_once("kmem.limit_in_bytes is deprecated and will be removed. Wr= iting any value to this file has no effect. Please report your usecase to l= inux-mm@kvack.org if you depend on this functionality.\n"); ret =3D 0; break; case _TCP: - pr_warn_once("kmem.tcp.limit_in_bytes is deprecated and will be removed= . " - "Please report your usecase to linux-mm@kvack.org if you " - "depend on this functionality.\n"); + pr_warn_once("kmem.tcp.limit_in_bytes is deprecated and will be removed= . Please report your usecase to linux-mm@kvack.org if you depend on this fu= nctionality.\n"); ret =3D memcg_update_tcp_max(memcg, nr_pages); break; } @@ -2551,9 +2538,7 @@ static ssize_t mem_cgroup_write(struct kernfs_open_fi= le *of, if (IS_ENABLED(CONFIG_PREEMPT_RT)) { ret =3D -EOPNOTSUPP; } else { - pr_warn_once("soft_limit_in_bytes is deprecated and will be removed. " - "Please report your usecase to linux-mm@kvack.org if you " - "depend on this functionality.\n"); + pr_warn_once("soft_limit_in_bytes is deprecated and will be removed. Pl= ease report your usecase to linux-mm@kvack.org if you depend on this functi= onality.\n"); WRITE_ONCE(memcg->soft_limit, nr_pages); ret =3D 0; } @@ -2847,9 +2832,7 @@ static int mem_cgroup_oom_control_write(struct cgroup= _subsys_state *css, { struct mem_cgroup *memcg =3D mem_cgroup_from_css(css); =20 - pr_warn_once("oom_control is deprecated and will be removed. " - "Please report your usecase to linux-mm-@kvack.org if you " - "depend on this functionality. \n"); + pr_warn_once("oom_control is deprecated and will be removed. Please repor= t your usecase to linux-mm-@kvack.org if you depend on this functionality.\= n"); =20 /* cannot set to root cgroup and only 0 and 1 are allowed */ if (mem_cgroup_is_root(memcg) || !((val =3D=3D 0) || (val =3D=3D 1))) --=20 2.47.0.163.g1226f6d8fa-goog From nobody Sun Nov 24 13:22:59 2024 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 A26221FDFBE for ; Mon, 4 Nov 2024 22:28:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730759291; cv=none; b=isXD4+UDSVxQQDxU8MY0qv3TLKk8bv1qZDRXeqmeqaiW6KCo73Y5ObWsmd4UzpinmEolcYDQ4NM33ndWTHHhx36CJwCL+RyJyfL4iRojGsfdGRlRQSSFX+KJDnBuA2q2W+0V0Wqz9FCg+UeR2eNaLNJn0bvY7SdwV8rSPZeaYl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730759291; c=relaxed/simple; bh=2ulKgS1WJ4dbuBnCKxnqeyIGe4MyeNcFUS3/7Qh/Yto=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=hL36ekdnf2PKed74fdhNgmGPOfXEBY5SLIuWCRKXyLn5NHDDqGRQ/ZwLlXHwa/LxnFD0AaLNKsXDv+ACwpLeBlBA24JaRSGLZMDt3u4hmkhoLpU8hSk3TAD2zrZHQTiBVcKYGYOcgOAqaYVA2aKsyaZT7bR+oiIl9/s1KlFNIzU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--kerensun.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=vtp3rzdW; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--kerensun.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="vtp3rzdW" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e02fff66a83so7475582276.0 for ; Mon, 04 Nov 2024 14:28:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1730759288; x=1731364088; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=15O9ca4pVZTESzuvBdGrLRHe530YHW6qwFu9Oe4DO8I=; b=vtp3rzdWidZf3C/8B8T5T36g2m2yAh4UzT7nJvtEPnSY1lLbPDQXkifhZRVSCgupIH +V0Ow/e0ohARg8vr9kBTLgTxvul/BQv3PsFkszxG8bMmS2K3mQiayERZZrKqunanQnOK jxhw+p1VBXc50MpOscDDSWYYyaYIQGhtLIy6vG1ylJRf1bk8aZJ1fcYTJRguMZCBIlHx NJwSrmEyHnO9UDgAwG56Sl5nW0p1+cjXpQ3HIgacTKHM6kHi9tvE7mfJoy8jOmoUDo0W JufZVYykULhG6q0SEB1+X8UbgRWcB7pUE08DSO/uYU7hjKhRRiKkwyPlfzBaxC9jCM2H bDOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730759288; x=1731364088; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=15O9ca4pVZTESzuvBdGrLRHe530YHW6qwFu9Oe4DO8I=; b=qW6xTXOzsYYnIl+JhMG2XMKopopxfaL/dCCxd+fwwfSugQ9y0JYv/NLRG8aUhqCzwU mKWRDvkqqO3IsXh1g+fjE/tpqpn/HLfVB8x2ZtPiuQyP6zkHiuILlXpco/6IKL4lGdNE vaKX31c58BsCGbtBkaKxjBUJQM8DqzkSTB63Acgp4VWOpCcZR7/dEuroE1W7uRbD1i1h +AcMXeRCRsp56igerhWZu7P4UXe7IzLYs21RUA3c/9LzOeGyHDljeV13hAKNK6zoAyrw v6haLRBVIidqIdE8MYS3OqAIYN2g9ZqLVqt8FrIJJKjvqyeeGkSujLXXUcgZlIuO7qcr gNQQ== X-Forwarded-Encrypted: i=1; AJvYcCW9vnz8HV6gwTojQu9WF9MLkVQ8BDFDdTUDTd4DdbOHQ84Yy/KoVYVamPG9VVLudTahbKoryJ9KaBCf7WI=@vger.kernel.org X-Gm-Message-State: AOJu0YxdLGBzJ4sjQAuXGMUJyewCrq8zXC5JMAG38yqLlGRL1QyDR/H3 ma+lllMEeEAVXuwW+00B1C7g/KrQChG4MIECYei2l0JaLI1mUnaxNwfdaBrkZpgD+RcLxptfO3r N4W2ZL1srkA== X-Google-Smtp-Source: AGHT+IEpn3Ozfl3bEakiUcys3vke1g1CcEk4jHzka3T3PWfF9UiVOWvD6xNRzVdmFNyJHcOxgC4N0YzCvE4knA== X-Received: from kerensun.svl.corp.google.com ([2620:15c:2c5:11:2520:b863:90ba:85bc]) (user=kerensun job=sendgmr) by 2002:a25:b411:0:b0:e2b:da82:f695 with SMTP id 3f1490d57ef6-e30e5b0f56amr10735276.6.1730759288333; Mon, 04 Nov 2024 14:28:08 -0800 (PST) Date: Mon, 4 Nov 2024 14:27:35 -0800 In-Reply-To: <20241104222737.298130-1-kerensun@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241104222737.298130-1-kerensun@google.com> X-Mailer: git-send-email 2.47.0.199.ga7371fff76-goog Message-ID: <20241104222737.298130-3-kerensun@google.com> Subject: [PATCH 2/4] mm: Fix minor formatting issues for mm control From: Keren Sun To: akpm@linux-foundation.org Cc: roman.gushchin@linux.dev, hannes@cmpxchg.org, mhocko@kernel.org, shakeel.butt@linux.dev, muchun.song@linux.dev, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Keren Sun Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add a line after declaration as it's missing after DEFINE_WAIT(), replace the spaces with tabs for indent, and remove the non-useful else after a break in a if statement. Signed-off-by: Keren Sun Acked-by: Shakeel Butt --- mm/memcontrol-v1.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index 3951538bd73f..5f9d3d6d443c 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -460,6 +460,7 @@ bool memcg1_wait_acct_move(struct mem_cgroup *memcg) if (mc.moving_task && current !=3D mc.moving_task) { if (mem_cgroup_under_move(memcg)) { DEFINE_WAIT(wait); + prepare_to_wait(&mc.waitq, &wait, TASK_INTERRUPTIBLE); /* moving charge context might have finished. */ if (mc.moving_task) @@ -490,7 +491,7 @@ void folio_memcg_lock(struct folio *folio) * The RCU lock is held throughout the transaction. The fast * path can get away without acquiring the memcg->move_lock * because page moving starts with an RCU grace period. - */ + */ rcu_read_lock(); =20 if (mem_cgroup_disabled()) @@ -2096,8 +2097,8 @@ static bool mem_cgroup_oom_trylock(struct mem_cgroup = *memcg) failed =3D iter; mem_cgroup_iter_break(memcg, iter); break; - } else - iter->oom_lock =3D true; + } + iter->oom_lock =3D true; } =20 if (failed) { --=20 2.47.0.163.g1226f6d8fa-goog From nobody Sun Nov 24 13:22:59 2024 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 65FEC1FE0F5 for ; Mon, 4 Nov 2024 22:28:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730759294; cv=none; b=DzRbni4KafiyFqci8cjY8Nx1zwn1uAzBaJZv1sXQ9XGCKl5K5H7ls04avwUx0lvwUYYwRwBQ9FlkbHktUaOkBw0KMubefQHuHxVT6tomgEChguqWjTWuxw+D9z/M2OV7ive/OuJ8rGchudStixzPNOJpjA/ajDkF957J2kPf/xo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730759294; c=relaxed/simple; bh=+iOvuRNiKIbq55ASUVdH3ADxYemn89V9ikEUEtAXEBE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Ktt6SSoeKEHJ1JjGfk+BbV9EzbklI77TTpT3u0BAnNMY4d3WQ40e4PvX2QbNiJJKunAnMUc3E304Tr0D7vPCnybEBgSyPCygc6uHOF5t6DXkuLjKgt6r5MjL8b2cglwAn6Hm+xYhtKuJpmi72/8OxRBCC9OIqIh1ivppAcu2YW8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--kerensun.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=NiBxjYn0; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--kerensun.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="NiBxjYn0" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e2e3321aae0so7389434276.1 for ; Mon, 04 Nov 2024 14:28:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1730759291; x=1731364091; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=FJTHsOFb69amuDKNp+L1s7mL9nLva+h50iWgGzl+suk=; b=NiBxjYn0/STNuIFzwHHaweSoLJezHWzij53EBAd6b/qUv3WprGZFbdbWvNoDY4werM 0lhx2CyhhvyXe1/LiKPzRLF8VdlnMYwKFS3D/EcEaYsMhd0LPhEMQT4lhbuZJEyCSpsN JcsLVCow60KskstofdSTyW04cEfI9ELfIq3h32Tdsdx5aV9hL57bgOpQxpyHQFIWsZiP duvjlurRshcor24TwKZlcGEovMBTny+0rQ/Xz13S4sWA9D+g9888M27thrCxA5VMS4pZ kYfq1YSsRA7vztJssAUPj1YJOPx8MKfUmjN+pCl3C9cCms29GiRcVXMY1z6TR8+LCZDQ HcSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730759291; x=1731364091; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FJTHsOFb69amuDKNp+L1s7mL9nLva+h50iWgGzl+suk=; b=lwmkAuDRUiYzzYWlHp16ySyo7I+ZoHhIv4+2VM7a82GAd82/w8DkiLz1Ss+NArwuBH Hito/qOSTXkpw68G7kiuiBT0C+N2EJtxZVUchNSJtVTqTGPvgA+3Mg/WKHvKCToMs6RW Y8uouS99Rjo8fnscnsg2bwCo9FfdEez+atfjKnBJifLJztzOzDCTQdSrlT28WdMlDs5Z rc4UW9v4OhgQVDijWqRIkdd8Cktn6t619HY+mRQ5c42Y971jHtePYQRPUFBB0S18SnEX IYgyhhXyj9Zfgkxy826BnnAvaXn6pvpj1bg5Xaltnmemvr0l7YFvcrzgB/sOLOjkQrcT Knkg== X-Forwarded-Encrypted: i=1; AJvYcCW0Hfzq+NoThWGc57e3LCB87rjW+QDzVmNQFnOMv9YPoMW84sGIXhGDG5Oi9mui9fBNtqP68rLfyQCbunU=@vger.kernel.org X-Gm-Message-State: AOJu0YzcCUc9Js1Pm3jrwOZPSqP6oiFhes3pVcdu+DwxI69/iV5NvPM5 KSa2hjF3g9OQH1bnOYwVpf1Ai27L/W9rd6ug9ceGG5eURhrAlG60QJyW261dMz+WFMykDICi9Jv fh5bMeYpkSw== X-Google-Smtp-Source: AGHT+IEg/gpZS2Wwa740IUzym+/kFOc+iN2HO8l3hmsWV/sKpXe65l+xXYWOwxm8vBrp8FmpwtXAU3uOAkOjqA== X-Received: from kerensun.svl.corp.google.com ([2620:15c:2c5:11:2520:b863:90ba:85bc]) (user=kerensun job=sendgmr) by 2002:a05:6902:1d1:b0:e2e:3031:3f0c with SMTP id 3f1490d57ef6-e30e5b0ee45mr11671276.7.1730759291389; Mon, 04 Nov 2024 14:28:11 -0800 (PST) Date: Mon, 4 Nov 2024 14:27:36 -0800 In-Reply-To: <20241104222737.298130-1-kerensun@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241104222737.298130-1-kerensun@google.com> X-Mailer: git-send-email 2.47.0.199.ga7371fff76-goog Message-ID: <20241104222737.298130-4-kerensun@google.com> Subject: [PATCH 3/4] mm: Prefer 'unsigned int' to bare use of 'unsigned' From: Keren Sun To: akpm@linux-foundation.org Cc: roman.gushchin@linux.dev, hannes@cmpxchg.org, mhocko@kernel.org, shakeel.butt@linux.dev, muchun.song@linux.dev, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Keren Sun Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Change the param 'mode' from type 'unsigned' to 'unsigned int' in memcg_event_wake() and memcg_oom_wake_function(), and for the param 'nid' in VM_BUG_ON(). Signed-off-by: Keren Sun Acked-by: Shakeel Butt --- mm/memcontrol-v1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index 5f9d3d6d443c..5e1854623824 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -1851,7 +1851,7 @@ static void memcg_event_remove(struct work_struct *wo= rk) * * Called with wqh->lock held and interrupts disabled. */ -static int memcg_event_wake(wait_queue_entry_t *wait, unsigned mode, +static int memcg_event_wake(wait_queue_entry_t *wait, unsigned int mode, int sync, void *key) { struct mem_cgroup_event *event =3D @@ -2165,7 +2165,7 @@ struct oom_wait_info { }; =20 static int memcg_oom_wake_function(wait_queue_entry_t *wait, - unsigned mode, int sync, void *arg) + unsigned int mode, int sync, void *arg) { struct mem_cgroup *wake_memcg =3D (struct mem_cgroup *)arg; struct mem_cgroup *oom_wait_memcg; @@ -2598,7 +2598,7 @@ static unsigned long mem_cgroup_node_nr_lru_pages(str= uct mem_cgroup *memcg, unsigned long nr =3D 0; enum lru_list lru; =20 - VM_BUG_ON((unsigned)nid >=3D nr_node_ids); + VM_BUG_ON((unsigned int)nid >=3D nr_node_ids); =20 for_each_lru(lru) { if (!(BIT(lru) & lru_mask)) --=20 2.47.0.163.g1226f6d8fa-goog From nobody Sun Nov 24 13:22:59 2024 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (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 DCE091FE0F4 for ; Mon, 4 Nov 2024 22:28:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730759298; cv=none; b=GMMBEX0Vzco6V1YuZRH/kByyYanRyBtV5bacWDuUfqDEqB2MSRyiuZABaXgTb/oRselQslPlKfYLvPTHY6GeEndjAYtnE8up5r4QECjkYObp9KKFCPqqQaCMy49ubmQbW/VVVoVo9ZFYcKWbL3iZEPI/NxFC2/Tfyrwmp4+0c9A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730759298; c=relaxed/simple; bh=jS3VhDQe0RHXucAy7fChPZMlDpJINb08hArPK+wtgmU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=NoF64uEdGhhbMlaiRutZkz/4nKUFliCeNtxXEvcm0lAkWwHE4vo4RjNx8cjGE0OQ/DJvyPRz8e7vRgY0F3Wpw7kHmewwfD4tlYQPWKRoK9y+MSPRDipdt5sLoDQWN1n8zqr7UGCUxa5eg8Ks7V/DQJ9sYtV7GYqi1h4NZzkbtww= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--kerensun.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=1RWd7Bvv; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--kerensun.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="1RWd7Bvv" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-6e9d6636498so92887367b3.2 for ; Mon, 04 Nov 2024 14:28:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1730759296; x=1731364096; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Y1YSqDn0sbFO9SXEJcmAUmq+AuYyNB6VQvHAGKw4UO8=; b=1RWd7Bvvundou4AKtP3w4KX4AnJF8pVzjJVliEC9YSRGHDjeWLkeIEvfd8Hcn9bS/A MtGwsRfSkIrDT1cIOvzks70dr5M6kQoF09O3epxCRzVmZFQSNRf7iS+I2HUaO8mUSlcE cfGFi8UPMKFPWBXmbvfp18g+ueZ1hF9eWsMWAdC6d/u+hG/x3cEFtDTJ1twnqgZ1SNNU t13uWSlaG8Rnw5OMa+hzs2xqbrGRZ/2L+G2uU8YUfXI8Br67pZeLfct2EXAup1FgRl7W Ux4d+80gbICiMzZ6uAmW1XIoPcocX4bYVZjavMccepPY/m40eyYCng9XdbT5Kbaf/pFo xP2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730759296; x=1731364096; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Y1YSqDn0sbFO9SXEJcmAUmq+AuYyNB6VQvHAGKw4UO8=; b=CVEiMrXDmjJLKiuAM6zpA7OZOSGzP46dNxL7xqF66bPDVZA4bGpmSQP6UF5FUHhBFA oVCdzHCpcvp84pAQhZabi2qRJda7EzllD0TMKzpY1so4CDTrDdQE0L4Yx179PfgwKDWs KIrrvrekMZlIs+fWh6FngboHm/9Hn8cU49Ckw00IL4M3e1qUkacs+l7kfimYXs0uZAVz d5/IT+S5fLPFCZnASnwxOs94taj3yqb+Bl7qHzezHL/P8fosxyVdTSz6PNgRnxAIv6ri kPTRdoq7jPOOlyCpwSaetXoud2cmSmpKlOYvXop3jdkkMXvyix2zP1qdRvTUPdhmzQUY yNLw== X-Forwarded-Encrypted: i=1; AJvYcCURoIdmxqTN2hH10zzW8tcgWycbr2lMqUEpZePvdhYemERUzg43az/kAHZ+xAtqSCTFdyl7/IdIkfm3Nqo=@vger.kernel.org X-Gm-Message-State: AOJu0YxhCShra7yLyyA5l669BRQr2j2CqGEKiTuTRr9SjgGH7Fqz2eFM gLbBGXsEP8RfFztR+hOWJl82Ox9wb5iERSQAPfsrbQokdjWIYstiy4s5L3yTeftSMeYJmAdN39w j+jJyLaywDA== X-Google-Smtp-Source: AGHT+IEwJ6XoH9jYvE9XepfbYW66gSHe6pDYBUEJ6j7mRhsOIIUs4LZTeXXSxAJhVRpRqXv6MfH+lzcIHJo1EQ== X-Received: from kerensun.svl.corp.google.com ([2620:15c:2c5:11:2520:b863:90ba:85bc]) (user=kerensun job=sendgmr) by 2002:a05:690c:802:b0:6ea:1f5b:1f5e with SMTP id 00721157ae682-6ea52518ac3mr273147b3.4.1730759295937; Mon, 04 Nov 2024 14:28:15 -0800 (PST) Date: Mon, 4 Nov 2024 14:27:37 -0800 In-Reply-To: <20241104222737.298130-1-kerensun@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241104222737.298130-1-kerensun@google.com> X-Mailer: git-send-email 2.47.0.199.ga7371fff76-goog Message-ID: <20241104222737.298130-5-kerensun@google.com> Subject: [PATCH 4/4] mm: Replace simple_strtoul() with kstrtoul() From: Keren Sun To: akpm@linux-foundation.org Cc: roman.gushchin@linux.dev, hannes@cmpxchg.org, mhocko@kernel.org, shakeel.butt@linux.dev, muchun.song@linux.dev, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Keren Sun Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" simple_strtoul() has caveat and is obsolete, use kstrtoul() instead in mmcg. Signed-off-by: Keren Sun --- mm/memcontrol-v1.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index 5e1854623824..260b356cea5a 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later =20 +#include "linux/kstrtox.h" #include #include #include @@ -1922,17 +1923,15 @@ static ssize_t memcg_write_event_control(struct ker= nfs_open_file *of, =20 buf =3D strstrip(buf); =20 - efd =3D simple_strtoul(buf, &endp, 10); - if (*endp !=3D ' ') + kstrtoul(buf, 10, efd); + if (*buf !=3D ' ') return -EINVAL; - buf =3D endp + 1; + buf++; =20 - cfd =3D simple_strtoul(buf, &endp, 10); - if (*endp =3D=3D '\0') - buf =3D endp; - else if (*endp =3D=3D ' ') - buf =3D endp + 1; - else + kstrtoul(buf, 10, cfd); + if (*buf =3D=3D ' ') + buf++; + else if (*buf !=3D '\0') return -EINVAL; =20 event =3D kzalloc(sizeof(*event), GFP_KERNEL); --=20 2.47.0.163.g1226f6d8fa-goog