From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-171.mta1.migadu.com (out-171.mta1.migadu.com [95.215.58.171]) (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 CD03A3148D8 for ; Sun, 12 Jul 2026 09:34:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783848844; cv=none; b=u7NtxNoLXftX7VTwY/gvYd58WJaRGXsLLkYHlsn21K58f08YgtqbA7rehab9ubJOPwF+dUUFyaUXoi8X/tkOVnDHxYDQorfLgIwd0cn+7tNM01dwprD/S5NEDwcbXVBulp2UNPPXzyJBLCIBp5M/EstXtJNDb3jeoB/19Mec2go= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783848844; c=relaxed/simple; bh=nD/AvvWdsR/rAIojGaVrHBvaqKUN4H6uctzMK1yk6KQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pIFrK0CwRZ60eM5g58Wx3j1a9LhU/kSZCET8RVB8NTLsTmh5U96ZsiwEsLUmv2btyeyt7yRhEitIfv6uxxKnPVgyzKOk7XLvZwqwIJd2xd55C+ibHG1dEEQKqghNE8WOD2u/kGoJQtCxzKjNyiJPNMNxodXZKPQyrMGf9ERyppw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=fRR82dfO; arc=none smtp.client-ip=95.215.58.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="fRR82dfO" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1783848839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=vMx3q6WpMdIPab9rV2riWxB+G+tfX1FJkOnRzcZxCMc=; b=fRR82dfOdn+VsVP0GrBzLtK2kEe5psEyw1vXpLDqwYqN7kw82/9Uxedj09hYh36Q8QYjQ+ r+yybcGMmLME0O0hoihn3V6eoqpfjEex5anJ+kHhX6q1wNYwBV/R9bideOmCPsC9qKmv2d 9frD2+PFZFe3MTsK/0bV4UPni/YNJu8= From: Kaitao Cheng To: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R . Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Julian Braha , Muchun Song , Kaitao Cheng Subject: [PATCH] mm/kconfig: Drop redundant dependency wrappers Date: Sun, 12 Jul 2026 17:33:26 +0800 Message-ID: <20260712093326.8313-1-kaitao.cheng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT From: Kaitao Cheng Some mm Kconfig entries repeat dependencies that are already expressed by their surrounding blocks or menus. The zsmalloc allocator options menu already depends on ZSMALLOC, so the outer if ZSMALLOC block does not add any extra constraint. MEMORY_HOTREMOVE and MHP_MEMMAP_ON_MEMORY are both inside the if MEMORY_HOTPLUG block, so their local depends on MEMORY_HOTPLUG entries are redundant. PTE_MARKER_UFFD_WP is the only entry under if USERFAULTFD. Move the USERFAULTFD dependency into the symbol itself and combine it with the architecture support dependency. This keeps the same visibility and defaults while avoiding duplicate dependency expressions. Suggested-by: Julian Braha Signed-off-by: Kaitao Cheng --- mm/Kconfig | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/mm/Kconfig b/mm/Kconfig index ff29f770d10a..7d1524e5c3d5 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -125,8 +125,6 @@ config ZSWAP_COMPRESSOR_DEFAULT config ZSMALLOC tristate -if ZSMALLOC - menu "Zsmalloc allocator options" depends on ZSMALLOC @@ -161,8 +159,6 @@ config ZSMALLOC_CHAIN_SIZE endmenu -endif - menu "Slab allocator options" config SLUB @@ -591,12 +587,10 @@ endchoice config MEMORY_HOTREMOVE bool "Allow for memory hot remove" select HAVE_BOOTMEM_INFO_NODE if X86_64 - depends on MEMORY_HOTPLUG select MIGRATION config MHP_MEMMAP_ON_MEMORY def_bool y - depends on MEMORY_HOTPLUG depends on ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE endif # MEMORY_HOTPLUG @@ -1391,17 +1385,15 @@ menuconfig USERFAULTFD Enable the userfaultfd() system call that allows to intercept and handle page faults in userland. -if USERFAULTFD config PTE_MARKER_UFFD_WP bool "Userfaultfd write protection support for shmem/hugetlbfs" default y - depends on HAVE_ARCH_USERFAULTFD_WP + depends on USERFAULTFD && HAVE_ARCH_USERFAULTFD_WP help Allows to create marker PTEs for userfaultfd write protection purposes. It is required to enable userfaultfd write protection on file-backed memory types like shmem and hugetlbfs. -endif # USERFAULTFD # multi-gen LRU { config LRU_GEN -- 2.50.1 (Apple Git-155)