From patchwork Wed Jan 17 17:10:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Breno Leitao X-Patchwork-Id: 188901 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:30f:b0:101:a8e8:374 with SMTP id ia15csp52710dyb; Wed, 17 Jan 2024 09:11:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFnGZ4FqhhEwtgMvO3crahj8IKntEKVgIIZiSoVEShREhDubHAt63mrIUZT9HjakPD+ptEx X-Received: by 2002:a05:6512:3084:b0:50e:6cce:f83 with SMTP id z4-20020a056512308400b0050e6cce0f83mr5544410lfd.41.1705511514932; Wed, 17 Jan 2024 09:11:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705511514; cv=pass; d=google.com; s=arc-20160816; b=cvB02D8De9MDtMQV/PbKHHRzNGzzYNTj9YUfXpX/pZ38ZMgVM7EgjeMdDmAPtONBLC BzeXjO449xa1whETUKi0pA1mzkpvGXfVVGp1ej79hpIPtbZO4Tc1cYkFcbSReFzYeBlx iWubPC5qrDG5u9BkE8hw43ZatuCWKkP0W8qh8z5aP8a3kNJL/ho6RBkN9o27khjjqiwa 1COfMWnX3xkoOecl9z5M70M+BKYcarmzA8awLAF7VVH+Mb9J+qj4ilw0cqii7bK9gktH GASn7cwPy+x3D8puvoWWbB2CwZSYaCqG885utqUDvxz9Mvl9s/PSDxe45fFAtuRcv3pi +/aQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=zJ2+XhKbom46b/fZIunrod77ylLhDHU0KUj29SPzLh4=; fh=Q54OXt/qRxrTtd0mSEE2XGJd4z99RHMb/29q6WtXyZg=; b=mN+Po3bt6QviE4mcJm6OMrG6uAmJau9LYq1boFPlWGMw3t+FcI+mPNGWlmGgl+K16I 1eoryFzM6Ts9jNmib6FO++9ZHubo3aSw7HqFDR1onE9NmoON/icIqmmLn2kpw9oXwPcX ywC6bNKBZtuSJ6GbWL1Tlnm4Sb2IVSlDyYSQ6X3LyJjO+5tVhdsYs6RqQnOIbz0l4g9F HPV6EWAQL6SOj8sM+sVT0kkaboQaAAodOoICES9+l2EfZxO4gbr4G7RcU2vA1sc7bsGv 7AfcixleGFlQCjWKbe5UNU4Ok0JnOeT4ePKNxfnObpOg4DbGhPHsA+QgvKr4uXdcgIwy MrOw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-29260-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29260-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y14-20020a1709063a8e00b00a26add7df8bsi5827395ejd.109.2024.01.17.09.11.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 09:11:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29260-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-29260-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29260-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 864AB1F23496 for ; Wed, 17 Jan 2024 17:11:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2DEA222F19; Wed, 17 Jan 2024 17:11:19 +0000 (UTC) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (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 16C45219F2 for ; Wed, 17 Jan 2024 17:11:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705511477; cv=none; b=Pt5V2rBrG//JYjkV96bShddfe4xXD14/4KSDZcwVlbJhwFrnOGElv7wNU/4nTG0W5Z4kNPhJgpQAwZpz107l4u6Tb36ZZ8/0SCafuASZr9ZnCeltw1noIVDdFE4v5gyC3Aog0nl6KmrVFHqFbvz5syNpL8yKP8rtYv+GZl+Ecow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705511477; c=relaxed/simple; bh=yRA1Nvwd9G6y3dgBa4YVeXvCTThqtHdsWY4phzrl/lU=; h=Received:X-Google-DKIM-Signature:X-Gm-Message-State: X-Google-Smtp-Source:X-Received:Received:From:To:Cc:Subject:Date: Message-Id:X-Mailer:MIME-Version:Content-Transfer-Encoding; b=ETRoc3nAzSX6BsotQ4rv7t2KIggpG/5P6nTC1Fdx+0+KtltJbCbrgjjWfqebaxGDWJ39MlpfEbvi/EQl+5xx4tbqziEFkuAqhATFtiXmCln7zwuneqxiTlDYkCsrFyVYWrPkL0YgThC/GJ2MuW6znBK5DQi8WA+juHGz+jwC2NU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.208.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2cdb50d8982so45619051fa.2 for ; Wed, 17 Jan 2024 09:11:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705511470; x=1706116270; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zJ2+XhKbom46b/fZIunrod77ylLhDHU0KUj29SPzLh4=; b=vwdWkgtHd4seFqFnUmJlABO4C3L8YNkXaReU8LVSlF31/uivSN/5sphvM4gSSjhG1e tq4S4g6cUcha00b7nAJEv7ME44guUvYva3vg63mKcbUAVrS1ZWXSNk64vSzQC3Bfeto8 YG56LzyaxOjpaYaXuCKQ5V0H2crcq31gbIm90zkALlMusTvBs/mWtV+EMFqKu0pZ0J40 wG+tXGbp4xi7awBiUx+p74rk+J7LET3iwnBPXh9n9tdK8u1e/A364I7bwSQIZse4f5v5 PVU+00DHqYV9Oz+n85ibrMKPoP+R7JXL0wCIlqqvqygi8XqI2gBH9nKZ+wq1AoRVcOtx G4Gw== X-Gm-Message-State: AOJu0YxduqKDx6P+1npHO5/GrU6Z/HPpwRvJ07kE15XKqa+3uYf2sPzV V/mp4lEWfV5tjleDB81a/0Q/yTuNzTc= X-Received: by 2002:a2e:7d12:0:b0:2cd:98e3:42b3 with SMTP id y18-20020a2e7d12000000b002cd98e342b3mr3866977ljc.24.1705511469837; Wed, 17 Jan 2024 09:11:09 -0800 (PST) Received: from localhost (fwdproxy-cln-025.fbsv.net. [2a03:2880:31ff:19::face:b00c]) by smtp.gmail.com with ESMTPSA id i13-20020a05640200cd00b00559c71e70e3sm1547951edu.79.2024.01.17.09.11.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 09:11:09 -0800 (PST) From: Breno Leitao To: Muchun Song , Andrew Morton Cc: lstoakes@gmail.com, willy@infradead.org, mike.kravetz@oracle.com, Rik van Riel , linux-mm@kvack.org (open list:HUGETLB SUBSYSTEM), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/2] mm/hugetlb: Restore the reservation if needed Date: Wed, 17 Jan 2024 09:10:57 -0800 Message-Id: <20240117171058.2192286-1-leitao@debian.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788358442355505237 X-GMAIL-MSGID: 1788358442355505237 Currently there is a bug that a huge page could be stolen, and when the original owner tries to fault in it, it causes a page fault. You can achieve that by: 1) Creating a single page echo 1 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages 2) mmap() the page above with MAP_HUGETLB into (void *ptr1). * This will mark the page as reserved 3) touch the page, which causes a page fault and allocates the page * This will move the page out of the free list. * It will also unreserved the page, since there is no more free page 4) madvise(MADV_DONTNEED) the page * This will free the page, but not mark it as reserved. 5) Allocate a secondary page with mmap(MAP_HUGETLB) into (void *ptr2). * it should fail, but, since there is no more available page. * But, since the page above is not reserved, this mmap() succeed. 6) Faulting at ptr1 will cause a SIGBUS * it will try to allocate a huge page, but there is none available A full reproducer is in selftest. See https://lore.kernel.org/all/20240105155419.1939484-1-leitao@debian.org/ Fix this by restoring the reserved page if necessary. If the page being unmapped has HPAGE_RESV_OWNER set, and needs a reservation, set the restore_reserve flag, which will move the page from free to reserved. Suggested-by: Rik van Riel Signed-off-by: Breno Leitao --- mm/hugetlb.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index ed1581b670d4..fa2c17767e44 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5677,6 +5677,16 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, hugetlb_count_sub(pages_per_huge_page(h), mm); hugetlb_remove_rmap(page_folio(page)); + if (is_vma_resv_set(vma, HPAGE_RESV_OWNER) && + vma_needs_reservation(h, vma, start)) { + /* + * Restore the reservation if needed, otherwise the + * backing page could be stolen by someone. + */ + folio_set_hugetlb_restore_reserve(page_folio(page)); + vma_add_reservation(h, vma, address); + } + spin_unlock(ptl); tlb_remove_page_size(tlb, page, huge_page_size(h)); /* From patchwork Wed Jan 17 17:10:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Breno Leitao X-Patchwork-Id: 188900 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:30f:b0:101:a8e8:374 with SMTP id ia15csp52476dyb; Wed, 17 Jan 2024 09:11:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHvshDPd4hzwClAS4HK6/tZ/LzsA2zZuqRb+UpwoCHREotVRKJO/CSMglZpJ9EI5ch0bNyR X-Received: by 2002:aa7:d9d6:0:b0:558:b14f:d3e with SMTP id v22-20020aa7d9d6000000b00558b14f0d3emr5272470eds.73.1705511495773; Wed, 17 Jan 2024 09:11:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705511495; cv=pass; d=google.com; s=arc-20160816; b=CnOQQJ9w3sx3phqY4COBw1xT0CQ3unbYVWbZbfhzk0xoD53vZwGYa3saAEBd47rrcd PmXP5JPCKhxI4L8xFQje/gmDvB09BUGCFz6yTi6Oksj3fYuBl9c0FumW1qz4rGgysB4v lcg77ixd0TF5p4oM4jFZopNDw0tgyOLv6wjHOk6T8OpTe33I7S9FsS/mV/z+vJEMKDUC 37cMhqaGmfwYPthAToHJ0KGFmVMbwTeZGGUUw0kPoUY+xLB30G23ITck9g/onWoHs992 n0YlGAQcwnIVNVkRc5DF7VBACUpahvyUSV0vWac/almk+/XEOrH4yuDDCYLKZN4U86BP d2IA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=DP69PvOk+lQM9++boQDvvmgfxQpk6r9vRPbBVvGiiUQ=; fh=I8HjtjoF0Hxl/+NCvSvCica0AD96D6LZBzXVRBh9LXs=; b=nsZBlqP+ufo7JctoCiXi0RG8oaaZgnOLon1cEg+2iWzh1Eo3LaTA0voOlHRuFK49U/ WGoKX6JchwmFK4KLvtuZ+DTrGnfJIF9hXTxVZMlhp0bEM6Fl0lKetyn36lqEfJ9ZRWbF CLwK2cQckyqEz5/lUWYe17fq06/w7XqgaIS3V1ZtPDZ/ge7riO4GAarttC1TXM1KXOaU x/nsV2aFcivrbXrGLLuoiniGL5s5vcH75IUStjSOmEvyJupiEmaV4gf5hmBwct+WPqEw tUF+NxsXbj6d9RU3YCCWL73m3ry5lvkpz0gCQqRGGVKIlnyGLnvBrHv1rqpxHdoF32/W x6/g== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-29259-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29259-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id fj8-20020a0564022b8800b00559cd2878cdsi994815edb.14.2024.01.17.09.11.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 09:11:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29259-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-29259-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29259-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 64CC11F226DB for ; Wed, 17 Jan 2024 17:11:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B00522EE1; Wed, 17 Jan 2024 17:11:16 +0000 (UTC) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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 686E7225A1; Wed, 17 Jan 2024 17:11:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705511475; cv=none; b=UvMKZbBTqrxlpsWH0NqYrjXhTZ7AZzhmCEqZjr/fs/ZG3F9VEvjIKXOLbF62kcwS41vInkiu3KYD+e1/RxoXJmilxzMapoRVwNIJawahon63iTY9KxJDbEmgIpLRY4mglhvvd+tbrflHZsg9DcVzgoIWKk0h1iPLDu1Uoovt4cU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705511475; c=relaxed/simple; bh=PZbG6wx6NcdMWESuC+ecFyqFqTXV45MvcYYsex4YP8g=; h=Received:X-Google-DKIM-Signature:X-Gm-Message-State: X-Google-Smtp-Source:X-Received:Received:From:To:Cc:Subject:Date: Message-Id:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; b=NZEVrEYX4qgqe9DI4BiIBmiGRMcevI1jVDlLN+PxOyDOUxjJ4xXFD39EcDqrD4RyO+q06oppkOpCPQtlhNIata+DvzANbBt2vDM2rsuRaZKNT7/yvincfQtKYR/Iw7Cf54yvPAH+lz6lOwjqinlejPgXIWO1PlToubkLF1COxYE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-50e7f58c5fbso15360504e87.1; Wed, 17 Jan 2024 09:11:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705511471; x=1706116271; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DP69PvOk+lQM9++boQDvvmgfxQpk6r9vRPbBVvGiiUQ=; b=krbpWVZ61mdHvgvJJ3zFaSrZR6Fi7EjCT4579nNbPKPjgZSOJVUzha4tii//XxkVub 6hdSFHqoQ4yUaPd2lHxZp+2rvS53Hfq2Ky5gYoUH+9vaKXuYzxrG8rJpbLC4K5zUDvII K8D3oKrXYSamrutm0oqtH5/lrzIGOQ74ezBW3Nk+Jev4U79TQyyHCdNd5dQEYqT5gqeP D9aJ++TH/enRhNN0z3zjScc4/3j7gvH/WIHvoQ37BCS0BBgr8b9cwHBS5OgljhhT6Xll DI17cZSy781zwUx8RMiwMea0v+DI9iqCrFHS0Gx5EJNamUgWDlIgq+FWbyJljwL82kD+ KVmw== X-Gm-Message-State: AOJu0YzH97Vq5uO9s2o2N0l+1ztyXUyXHYTb+09djTduGpeQcIm5mf7D 6I8AlP+fe5k3buInp8JrQh8= X-Received: by 2002:a05:6512:1155:b0:50e:7be3:c707 with SMTP id m21-20020a056512115500b0050e7be3c707mr5552398lfg.19.1705511471369; Wed, 17 Jan 2024 09:11:11 -0800 (PST) Received: from localhost (fwdproxy-cln-005.fbsv.net. [2a03:2880:31ff:5::face:b00c]) by smtp.gmail.com with ESMTPSA id p26-20020a1709061b5a00b00a298ade2e72sm7992905ejg.195.2024.01.17.09.11.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 09:11:11 -0800 (PST) From: Breno Leitao To: Andrew Morton , Shuah Khan Cc: lstoakes@gmail.com, willy@infradead.org, mike.kravetz@oracle.com, linux-mm@kvack.org (open list:MEMORY MANAGEMENT), linux-kselftest@vger.kernel.org (open list:KERNEL SELFTEST FRAMEWORK), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/2] selftests/mm: run_vmtests.sh: add hugetlb_madv_vs_map Date: Wed, 17 Jan 2024 09:10:58 -0800 Message-Id: <20240117171058.2192286-2-leitao@debian.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240117171058.2192286-1-leitao@debian.org> References: <20240117171058.2192286-1-leitao@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788358422384848479 X-GMAIL-MSGID: 1788358422384848479 hugetlb_madv_vs_map selftest was not part of the mm test-suite since we didn't have a fix for the problem it found. Now that the problem is already fixed (see previous commit), let's enable this selftest in the default test-suite. Signed-off-by: Breno Leitao --- tools/testing/selftests/mm/run_vmtests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh index a5e6ba8d3579..f41e1978e4d4 100755 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -256,6 +256,7 @@ nr_hugepages_tmp=$(cat /proc/sys/vm/nr_hugepages) # For this test, we need one and just one huge page echo 1 > /proc/sys/vm/nr_hugepages CATEGORY="hugetlb" run_test ./hugetlb_fault_after_madv +CATEGORY="hugetlb" run_test ./hugetlb_madv_vs_map # Restore the previous number of huge pages, since further tests rely on it echo "$nr_hugepages_tmp" > /proc/sys/vm/nr_hugepages