From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-187.mta1.migadu.com (out-187.mta1.migadu.com [95.215.58.187]) (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 CCBEC2E3AF1 for ; Wed, 8 Jul 2026 13:49:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783518553; cv=none; b=om1my9kNFvsqY9wNTzI44oq/UAQTZSX4qIGKNR/oMqzfRzXIS/luDlBl8XnZvJVursTMvub6ShLUycUiWbDe+W3C0I7lXtQpz7fxAr7nakGCtWRU8zlDZ8PiYueJ++HLyrUI85/8SMzqz4t80Uq1y0uXCgAeSPveTUAqoSjWDqA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783518553; c=relaxed/simple; bh=tKvFGGxeRm9+aPjHwPPw9jq2Xo1UZNf4SZGRpSI8yv4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NxSbiRuX/ZK2Y8j6RWhcX43l0FFNOfQJsGTiv6nENocoCb+/ScFrILvT4j4eu4j095ck8cvNCcbg9R75EiGPIoUiojKshoJNWBBma1HrGVa87IDcj+73dII8HM3aS0Jlovus/opQyH/SNgI12QUX4ujdBMOAanQNt+USYZPueRc= 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=mXbZxdXN; arc=none smtp.client-ip=95.215.58.187 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="mXbZxdXN" 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=1783518539; 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: in-reply-to:in-reply-to:references:references; bh=TEGzzoFWcnNWGGmasKpR7vNO3wPHNttV6bHdoJJUeuk=; b=mXbZxdXNK8zwfiH+BaVAX/a14LKht5ZVC+Wv7EwJmNmgfH7LWboOjRCpvZuv44yqZ92n+L HTpOJmwORQJdus2K/nxg2k5sHDV24WBE1jpcCO3Xmgfz/8evz+Zw4qadzjqXk+l1Ie5Dkb HqYuO1oM26W/bUjStsW0rqIMNmJO8nA= From: Usama Arif To: Sayali Patil Cc: Usama Arif , Andrew Morton , Shuah Khan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Ritesh Harjani , David Hildenbrand , Zi Yan , Michal Hocko , Oscar Salvador , Lorenzo Stoakes , Dev Jain , Liam.Howlett@oracle.com, linuxppc-dev@lists.ozlabs.org, Miaohe Lin , Venkat Rao Bagalkote Subject: Re: [PATCH v3 1/3] selftests/mm: handle EINVAL when configuring gigantic hugepages Date: Wed, 8 Jul 2026 06:48:50 -0700 Message-ID: <20260708134851.4153021-1-usama.arif@linux.dev> In-Reply-To: <2e3b585cbb30b2fc495dcd49d75de6f6da61861c.1783446924.git.sayalip@linux.ibm.com> References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On Wed, 8 Jul 2026 12:29:05 +0530 Sayali Patil wrote: > Some MM selftests attempt to configure the amount of > HugeTLB pages of different sizes by writing to nr_hugepages. > > PowerPC hash MMU pSeries systems advertise gigantic hugepage sizes > but do not support runtime allocation of such pages, writes > to the corresponding nr_hugepages file fail with -EINVAL. > This causes the test to bail out even though the failure is due > to a platform limitation rather than the > functionality being tested. > > Ignore -EINVAL when configuring nr_hugepages so that tests continue to > run on systems where gigantic hugepage allocation is unsupported. > > Before patch: > ------------------------- > running ./hugetlb-madvise > ------------------------- > TAP version 13 > 1..1 > [INFO] detected hugetlb page size: 16777216 KiB > [INFO] detected hugetlb page size: 16384 KiB > ok 1 MADV_DONTNEED and MADV_REMOVE on hugetlb > Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 > Bail out! /sys/kernel/mm/hugepages/hugepages-16777216kB/nr_hugepages > write(0) failed: Invalid argument > Totals: pass:0 fail:0 xfail:0 xpass:0 skip:0 error:0 > [FAIL] > > After patch: > ------------------------- > running ./hugetlb-madvise > ------------------------- > TAP version 13 > 1..1 > [INFO] detected hugetlb page size: 16777216 KiB > [INFO] detected hugetlb page size: 16384 KiB > ok 1 MADV_DONTNEED and MADV_REMOVE on hugetlb > Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 > [PASS] > > Fixes: 27477b28b74f ("selftests/mm: hugepage_settings: add APIs to get and set nr_hugepages") > Co-developed-by: David Hildenbrand (Arm) > Signed-off-by: David Hildenbrand (Arm) > Signed-off-by: Sayali Patil > --- > .../testing/selftests/mm/hugepage_settings.c | 2 +- > tools/testing/selftests/mm/vm_util.c | 26 ++++++++++++++++--- > tools/testing/selftests/mm/vm_util.h | 1 + > 3 files changed, 24 insertions(+), 5 deletions(-) > Acked-by: Usama Arif