From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f74.google.com (mail-dl1-f74.google.com [74.125.82.74]) (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 9F1DE34D4D6 for ; Fri, 16 Jan 2026 18:44:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768589069; cv=none; b=JYEDAiUqXwOi7Vx/2fS30v596k1BaQb4XVIcRIze0gDbQrm/+i9kUcTu5k0chHbhoky0bKB+mWBO5xNshSWXAcX+NL3GRfSsOCpbMIeafia8bScUOmNlToqTFkYrBqIE9jy+5bydICT1/lUoN5kPotPpZaDo+BNor30F5hwQ1w8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768589069; c=relaxed/simple; bh=2cjH3BeJKr7kySKTSNu9Jkp6nte4kPc6qcz0FqlQDnU=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=Q4iZkHpdrUjlQjKH9M4dlNiYmV6xGAlfLuEtJw6UsFxkf08rb7aRJaXPwojujvr4hF0/CUIyg8G57/ZqPBfhq9mZ2KeSlqDDHQquLEVb/y3P0qlvotMITkXreAjuBsBwk0dLBtK6r6mYClhJjjB4mDyED9VPRkcRReoJF3gQNx4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--surenb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=w0PZAKZc; arc=none smtp.client-ip=74.125.82.74 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--surenb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="w0PZAKZc" Received: by mail-dl1-f74.google.com with SMTP id a92af1059eb24-12338749ea9so3004465c88.0 for ; Fri, 16 Jan 2026 10:44:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1768589067; x=1769193867; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=vR+hsRwa2XjjiaLZeoNzi5LCSQhiLxUxHN38JIbsMBo=; b=w0PZAKZcWBRBakOutw8zklWtbO7j9/e1fFwLJ/9OEsODNJwZ0BjMWgP/GBp3vLlaaZ wvAoc6yLahCpHqh6fsX160Udk4dEixfU2RtTJs56bbcfkemILMZKecV6aa7rvN6dlIcr D6xZauu0FZl1S4pFuB1yXKnPJPkyWXCDYlNiKkydXW9ilW3ZgtiylZS0q9pU7PurPzLM RLwXFox9N3kWW05a9p2AxlwZ7Stbup0is8Oey3hDrVM/oBT5ULVwWhFUyiDGXZpwYIgY hy0gE7sbd0XRTcMboi4JqWjF3nRmDKjrbTBkfhY7s6JgasKsl/HdtQsQzkwiNn+UNejg Gp4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768589067; x=1769193867; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=vR+hsRwa2XjjiaLZeoNzi5LCSQhiLxUxHN38JIbsMBo=; b=Rfi9Om/ERA5/M+M5WxKMNx16N0/1ukZSlt1Oov/nJxziuq2MXAWgAGJ5LO76I5Vlia 6zgpXthFvmyGPtDWpPhRBkuRtOEWc/DF3ix5t6YoZ4jo+J2YGuYhGXWcAkX5u6QFtRXR zvlpHJWFw+pOsK/jjEHR1jKeS4f+5KwNqeduc61z7hbg4DKCuQU48ML7qsS9TCxwvI7N tgQ5kur+Bz9zTDTW3TmReeLFwuJOdVDV6C1x5KHSHkg7zSWl7Z5l6Y+5bx0LSa2lA6v9 PZ4uIcwhgIRVXOnGQToe2QVx9GPkIuwn6HJnVKCYThGnm2fhXm9n0dOy7lANPnhVhbVZ aYkA== X-Forwarded-Encrypted: i=1; AJvYcCUHP3zXyV6YVadw2/iQxy/3pMAXpZkfwPY4tx37J/wEOvTNhx+oZnOF8kl99wiFKRIQ8/bbGf5DIf3qwYg=@vger.kernel.org X-Gm-Message-State: AOJu0YyNm54Yyn3JwLDmY1vPIFfrxAIeaMqILo7IxNgcpl5CDm8EoOJq w3Z8GHHGDkWa+dXNtkM35O6pH5wSuNQPCy1Fy3JGiHNtxK+qHOrQ9ZVaim5te3hm29ZjTzZZMwg hwpVc7g== X-Received: from dlbps11.prod.google.com ([2002:a05:7023:88b:b0:123:2dd9:db4]) (user=surenb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:e16:b0:11a:342e:8a98 with SMTP id a92af1059eb24-1244b282f14mr3555854c88.0.1768589066553; Fri, 16 Jan 2026 10:44:26 -0800 (PST) Date: Fri, 16 Jan 2026 10:44:23 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.52.0.457.g6b5491de43-goog Message-ID: <20260116184423.2708363-1-surenb@google.com> Subject: [PATCH v2 1/1] Docs/mm/allocation-profiling: describe sysctrl limitations in debug mode From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, corbet@lwn.net, willy@infradead.org, sj@kernel.org, ranxiaokai627@163.com, ran.xiaokai@zte.com.cn, surenb@google.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" When CONFIG_MEM_ALLOC_PROFILING_DEBUG=y, /proc/sys/vm/mem_profiling is read-only to avoid debug warnings in a scenario when an allocation is made while profiling is disabled (allocation does not get an allocation tag), then profiling gets enabled and allocation gets freed (warning due to the allocation missing allocation tag). Fixes: ebdf9ad4ca98 ("memprofiling: documentation") Reported-by: Andrew Morton Signed-off-by: Suren Baghdasaryan Acked-by: SeongJae Park Cc: stable@vger.kernel.org --- Based on mm-new Changes since v1 [1]: - Fixed a typo, per Matthew Wilcox - Added Acked-by, per SeongJae Park [1] https://lore.kernel.org/all/20260115054557.2127777-1-surenb@google.com/ Documentation/admin-guide/sysctl/vm.rst | 4 ++++ Documentation/mm/allocation-profiling.rst | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/Documentation/admin-guide/sysctl/vm.rst b/Documentation/admin-guide/sysctl/vm.rst index 9096e2d77c2a..b98ccb5cb210 100644 --- a/Documentation/admin-guide/sysctl/vm.rst +++ b/Documentation/admin-guide/sysctl/vm.rst @@ -487,6 +487,10 @@ memory allocations. The default value depends on CONFIG_MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT. +When CONFIG_MEM_ALLOC_PROFILING_DEBUG=y, this control is read-only to avoid +warnings produced by allocations made while profiling is disabled and freed +when it's enabled. + memory_failure_early_kill ========================= diff --git a/Documentation/mm/allocation-profiling.rst b/Documentation/mm/allocation-profiling.rst index 316311240e6a..5389d241176a 100644 --- a/Documentation/mm/allocation-profiling.rst +++ b/Documentation/mm/allocation-profiling.rst @@ -33,6 +33,16 @@ Boot parameter: sysctl: /proc/sys/vm/mem_profiling + 1: Enable memory profiling. + + 0: Disable memory profiling. + + The default value depends on CONFIG_MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT. + + When CONFIG_MEM_ALLOC_PROFILING_DEBUG=y, this control is read-only to avoid + warnings produced by allocations made while profiling is disabled and freed + when it's enabled. + Runtime info: /proc/allocinfo base-commit: eeb33083cc4749bdb61582eaeb5c200702607703 -- 2.52.0.457.g6b5491de43-goog