From nobody Sun Feb 8 05:35:00 2026 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.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 120E02FE578 for ; Mon, 2 Feb 2026 23:36:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770075382; cv=none; b=ZoZKOKE57o9BUeqHYXQcZi0QzIHY/WGIq16/eOVOSUvZpUv+Z2VME91Tc8HtlFPBeX6JAXMamF+z8nmmisI/0WSb0UkZdVH8QAU/hQdRMNHe4XQ6ao8woH++RoDNsj6gVYHWfm4m6cuhae4e7NalUa/8GSR5i0Ws4sd66K8xJpA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770075382; c=relaxed/simple; bh=Ifht1R8kZUSCoKMxmpBZigwsv/gdgzV4bTpCpX2eRUY=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=X+CN2G2sdWCULd1pk8T5fN16C7C6y8cA6yu7hV1vDAaWplS4adx2hC3HYLAbOGDjZybrkBQGtXRYam/mgIfqUehGTPLskbKn/7HWtkaZcdJbWEobtaJAY6QocVBW1deT/u7vlXEFmzEuyftbOSqnxBxVbltSdMNizQHNcOjgyp4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jiaqiyan.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=0cHiR2QC; arc=none smtp.client-ip=209.85.216.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--jiaqiyan.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="0cHiR2QC" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-353a5c295e4so185385a91.0 for ; Mon, 02 Feb 2026 15:36:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770075380; x=1770680180; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=HFS1GQqvu21jTqcZP0JP9sNvGByp+MCybzRBJ5Rkxhw=; b=0cHiR2QCDPzX7WWhfO7RuuBYDVJM6rDx2lCKt6J3rhV5kI0CHLOrhYXh+IXN67JiFc q6xexKfVKvriRCdArutLyeeXkMTBoNwWYHLN5p40y2oMUgWK5QKMP//czdAvQvBL4sUL vDEyv9tM1hOayhHtuLTOXeA3pQShgS2wWvuVFYpoJXEiZsE+yDlWDyJW4fOJzPifW6M1 U8MMNNw5KL9AtdfZwJL9B8y9+1RozSrDUQGHzOnCboD1WRuZ74yiBywpv+zMNg8jopuQ oaG0ccpnO1coUX3kAZtWJnUHkYcOPHfhrOWOaWF98pOfV5KhjzHGmVtWtHnyTWbFTer2 wlvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770075380; x=1770680180; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=HFS1GQqvu21jTqcZP0JP9sNvGByp+MCybzRBJ5Rkxhw=; b=CTEant2qyJGjOXO7d1ONtWqf4YsTS/BJVZ4zFjlBFHVhb6V/U9OY+Z6gtb0X0bOT5e JZJWz67rR5lX6TC6mRn2rTjHP3+NctT52mFH+VoX3s779Q7FNH94nEtdRkPFcyzkzBkA pt9PK9nvEg0T0SqKcvKxjsIShGQcL4CxTwHwNFfMgrQGZHPAD6Eu+V/iEb5tOfsM/tqw /OcFePlnDnqvxqHQP1utcMMaXTpG1hGfV5Lh6BVsw5tQ/rtmCC80j1moFGWwcNlp0EjZ vvTTUQmVlN3tvGPwQPbipQ4ys9CXnSnkit8yHDoJ+TQ8h9ex/MKwKShXXL1a12Yz7GZ1 mDRA== X-Forwarded-Encrypted: i=1; AJvYcCUGVpslzDvoRgsRP+E1baCkBH1n7/SIdAFbfEwuMyzroAYrNvuTHys7676g9mtjqcovhyG8VDi2UklPkVk=@vger.kernel.org X-Gm-Message-State: AOJu0Yzjmaai0G1EQejYY8jneOyeR/DtnOSwOV4r3bRcX4zRWjsn/O1R PBujrj81iVYcNKYJ2+9+06iSye3Xl/AqG/K/UCo6de6V+7xMMo1FEldxsRd3iH7MNzcZ7SKSwEa wIAcOfnDU/hXejw== X-Received: from pjbih15.prod.google.com ([2002:a17:90b:430f:b0:34f:8ef8:5834]) (user=jiaqiyan job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90a:d64d:b0:32e:4716:d551 with SMTP id 98e67ed59e1d1-354776d7905mr832636a91.6.1770075380357; Mon, 02 Feb 2026 15:36:20 -0800 (PST) Date: Mon, 2 Feb 2026 23:36:16 +0000 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.53.0.rc1.225.gd81095ad13-goog Message-ID: <20260202233617.2350734-1-jiaqiyan@google.com> Subject: [PATCH v1] fs: hugetlb: simplify remove_inode_hugepages() return type From: Jiaqi Yan To: jane.chu@oracle.com, muchun.song@linux.dev Cc: osalvador@suse.de, david@kernel.org, william.roche@oracle.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jiaqi Yan Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When remove_inode_hugepages is introduced in commit c86272287bc6 ("hugetlb: create remove_inode_single_folio to remove s= ingle file folio") it used to return a boolean to indicate if it bailed out due to race with page faults. However, since the race is already solved by [1], remove_inode_hugepages() doesn't have any path to return false anymore. Simplify remove_inode_hugepages() return type to void, remove the unnecessary ret variable, and adjust the call site in remove_inode_hugepages(). No functional change in this commit. [1] https://lore.kernel.org/all/20220914221810.95771-10-mike.kravetz@oracle= .com Suggested-by: Jane Chu Signed-off-by: Jiaqi Yan Acked-by: David Hildenbrand (arm) Reviewed-by: Jane Chu Reviewed-by: Muchun Song --- fs/hugetlbfs/inode.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 3b4c152c5c73a..83d71cea7e384 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -515,13 +515,11 @@ hugetlb_vmdelete_list(struct rb_root_cached *root, pg= off_t start, pgoff_t end, * Called with hugetlb fault mutex held. * Returns true if page was actually removed, false otherwise. */ -static bool remove_inode_single_folio(struct hstate *h, struct inode *inod= e, - struct address_space *mapping, - struct folio *folio, pgoff_t index, - bool truncate_op) +static void remove_inode_single_folio(struct hstate *h, struct inode *inod= e, + struct address_space *mapping, + struct folio *folio, pgoff_t index, + bool truncate_op) { - bool ret =3D false; - /* * If folio is mapped, it was faulted in after being * unmapped in caller or hugetlb_vmdelete_list() skips @@ -543,7 +541,6 @@ static bool remove_inode_single_folio(struct hstate *h,= struct inode *inode, */ VM_BUG_ON_FOLIO(folio_test_hugetlb_restore_reserve(folio), folio); hugetlb_delete_from_page_cache(folio); - ret =3D true; if (!truncate_op) { if (unlikely(hugetlb_unreserve_pages(inode, index, index + 1, 1))) @@ -551,7 +548,6 @@ static bool remove_inode_single_folio(struct hstate *h,= struct inode *inode, } =20 folio_unlock(folio); - return ret; } =20 /* @@ -599,9 +595,9 @@ static void remove_inode_hugepages(struct inode *inode,= loff_t lstart, /* * Remove folio that was part of folio_batch. */ - if (remove_inode_single_folio(h, inode, mapping, folio, - index, truncate_op)) - freed++; + remove_inode_single_folio(h, inode, mapping, folio, + index, truncate_op); + freed++; =20 mutex_unlock(&hugetlb_fault_mutex_table[hash]); } --=20 2.53.0.rc1.225.gd81095ad13-goog