From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 76EE21684BE for ; Thu, 15 Jan 2026 03:23:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768447417; cv=none; b=GhSFw5wRo/wkblkFJth28Rd9YDkwfEdZloiEGCwUaTCWzhFHinvZLtIBZko8q5gaHW7jtnd67Qsfs2U+TvQqrWJwvZI8HsegwIjoqL20C6N4SbHhZ6qNduMoyezHpwc5hnoH+WMWsZFP/wFcSFgPAK7ZlSFG7CXtXOJfrLVJDm8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768447417; c=relaxed/simple; bh=KN+zYSn8tDmLJyikkQkmn3ngIxIivedgTmssIMwqF8A=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=UPeB9zVGly8bIsmfOLrVzWENu+jkXE3YD0JB6xvZ1O8L2D2GTCylATPNOWDD9TYJHPMvXniFX/pmSdIxXhMi2k1WSFVXnCtbpzdiNbh1dJJzmFnEKcy+PODUq1yc8bRclnuimmJg130WN5boF8+pNtB0npM5tmEZBaDzuW+tqB4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=2euoCv+b; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="2euoCv+b" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE03DC16AAE; Thu, 15 Jan 2026 03:23:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1768447417; bh=KN+zYSn8tDmLJyikkQkmn3ngIxIivedgTmssIMwqF8A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=2euoCv+bvYSLHd+iLJPBfCTR9dYqkea4DbbiwXBQVYQLiOOXMeNpbH+FHFjIvShcI B/LLYSsCbZUlnmXrTOtJwOuJGFW2FgQG3FBnbyE1N8HBqOwClX0+VtD1Hpjt6azDwQ 5FH5bUfl4KIXmED3ylS4at9EIfR9Ky6Nz3VS/utE= Date: Wed, 14 Jan 2026 19:23:36 -0800 From: Andrew Morton To: ranxiaokai627@163.com Cc: surenb@google.com, kent.overstreet@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ran.xiaokai@zte.com.cn Subject: Re: [PATCH v2] alloc_tag: fix rw permission issue when handling boot parameter Message-Id: <20260114192336.9d98f0330bfd6c8638762dd0@linux-foundation.org> In-Reply-To: <20260115031536.164254-1-ranxiaokai627@163.com> References: <20260115031536.164254-1-ranxiaokai627@163.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 15 Jan 2026 03:15:36 +0000 ranxiaokai627@163.com wrote: > From: Ran Xiaokai > > Boot parameters prefixed with "sysctl." are processed > during the final stage of system initialization via kernel_init()-> > do_sysctl_args(). When CONFIG_MEM_ALLOC_PROFILING_DEBUG is enabled, > the sysctl.vm.mem_profiling entry is not writable and will cause > a warning. This sounds strange. Why would setting a Kconfig debug thing disable alteration of a runtime control? Documentation/mm/allocation-profiling.rst provided no hint. > Before run_init_process(), system initialization executes in kernel > thread context. Use current->mm to distinguish sysctl writes during > do_sysctl_args() from user-space triggered ones. > > And when the proc_handler is from do_sysctl_args(), always return success > because the same value was already set by setup_early_mem_profiling() > and this eliminates a permission denied warning. > > Suggested-by: Suren Baghdasaryan > Acked-by: Suren Baghdasaryan > Signed-off-by: Ran Xiaokai Should we backport it?