Message ID | 20221021163703.3218176-31-jthoughton@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2813EFA373D for <linux-mm@archiver.kernel.org>; Fri, 21 Oct 2022 16:43:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BD94A8E0003; Fri, 21 Oct 2022 12:43:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B89858E0001; Fri, 21 Oct 2022 12:43:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A9FFA8E0003; Fri, 21 Oct 2022 12:43:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 928EF8E0001 for <linux-mm@kvack.org>; Fri, 21 Oct 2022 12:43:57 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 592451205EE for <linux-mm@kvack.org>; Fri, 21 Oct 2022 16:43:57 +0000 (UTC) X-FDA: 80045528514.01.0C85D0A Received: from mail-ot1-f73.google.com (mail-ot1-f73.google.com [209.85.210.73]) by imf26.hostedemail.com (Postfix) with ESMTP id D78FF14003B for <linux-mm@kvack.org>; Fri, 21 Oct 2022 16:43:56 +0000 (UTC) Received: by mail-ot1-f73.google.com with SMTP id w17-20020a9d70d1000000b006619151992bso2005984otj.3 for <linux-mm@kvack.org>; Fri, 21 Oct 2022 09:43:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=AZXIzSP66kpr06+Kt+tXVsbo2+8AOhJazRiZYv7H/E0=; b=AaEDv6vDecL09NV8IK8qq+jwZiQZvvW6A8x7Ma8TJX0CZ7w6xMLKRf3Y909I4MsZZu 0hYooJEJeyPq66zTIVLiJg5dt/gi8xbCkq4HqSj0EjYIEz8fyCwDNYdQStbGaf9MswBA cM0TuGM5Hkk/qVgNL10a3ya+lk67Uue+WlYyzDhlhPN60sp+XydnBo5yzMI6BKPgITpI H+hf53xNhGv8YGv7YkIqkTgxh9mHI8YlwlzFtLYveDQJ8oSEEIKb54V3+B6SA/Eioz/A s4eUG3ERd3oa9TzjeUGeXvx0oAzfFHUOWw0ZDZJbL1DS3wUfuFPlKrawoJROET5ltInS kxow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AZXIzSP66kpr06+Kt+tXVsbo2+8AOhJazRiZYv7H/E0=; b=PDnN+QudLwPpLpU5akOJycm42Ji5sdyphhwo9Bdo6tKbnkpHnPBfINRCRRW61WVieE 077eD4DRqEx12l+FkFg9HjzR6L86FC/9OxS/TUG0nOm9CZfBtO0dHnfz45zvwHaevpVM YnHLAHheiwJJu1Ahy6JYQ7L6D8fyZzv4Rgg4jEuMJk+g1TVRb1CR/n0rMgwnXE0SWKsl qVWQ0KYXMlPWTZBR3oTRclHwUsRfb389q8UnyU+Juz23SkD3ZOuJCICh7jv2Y1yRovEg CsXhqONIiiJDcdnOl8GPXDjeVFvFbEd21km3s4DgVt0rJdNb8+wUJyadHfXqGOOO44HT NeBQ== X-Gm-Message-State: ACrzQf38BcFDrEiVCNi0805/bVUwvAlbvJ61vA8bmgfvNuwvjNkeiUnV quo9+DxB7QKcoFCHDxddPlE8482zlsprSlEo X-Google-Smtp-Source: AMsMyM5fFT2NWW07vlUOD6TzMkML3qSAAmP9Dq6cl7bToYf1cSTCX5pGnWQwkImQeBAyI0NRH5KmT/OClGf1fMeI X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a25:c1c2:0:b0:6c4:318:642f with SMTP id r185-20020a25c1c2000000b006c40318642fmr16424485ybf.561.1666370264324; Fri, 21 Oct 2022 09:37:44 -0700 (PDT) Date: Fri, 21 Oct 2022 16:36:46 +0000 In-Reply-To: <20221021163703.3218176-1-jthoughton@google.com> Mime-Version: 1.0 References: <20221021163703.3218176-1-jthoughton@google.com> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog Message-ID: <20221021163703.3218176-31-jthoughton@google.com> Subject: [RFC PATCH v2 30/47] hugetlb: add high-granularity check for hwpoison in fault path From: James Houghton <jthoughton@google.com> To: Mike Kravetz <mike.kravetz@oracle.com>, Muchun Song <songmuchun@bytedance.com>, Peter Xu <peterx@redhat.com> Cc: David Hildenbrand <david@redhat.com>, David Rientjes <rientjes@google.com>, Axel Rasmussen <axelrasmussen@google.com>, Mina Almasry <almasrymina@google.com>, "Zach O'Keefe" <zokeefe@google.com>, Manish Mishra <manish.mishra@nutanix.com>, Naoya Horiguchi <naoya.horiguchi@nec.com>, "Dr . David Alan Gilbert" <dgilbert@redhat.com>, "Matthew Wilcox (Oracle)" <willy@infradead.org>, Vlastimil Babka <vbabka@suse.cz>, Baolin Wang <baolin.wang@linux.alibaba.com>, Miaohe Lin <linmiaohe@huawei.com>, Yang Shi <shy828301@gmail.com>, Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, James Houghton <jthoughton@google.com> Content-Type: text/plain; charset="UTF-8" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666370636; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=AZXIzSP66kpr06+Kt+tXVsbo2+8AOhJazRiZYv7H/E0=; b=xuHU7tM6qlGVxo/0XvPqJZaYR4/rKd2vx2gWFxHazUX1xx8yA5oteWKqCJ7ADTFgi4kR6K E353iVNqLE5phQDlkOx2xnCnvBNj9D8G92/zWrPKUzqJNF/3t6f5Bv0LBvPEOTzGaDOKWi EFKMyTCoDLA7TwbKWIbIS90vcIjVA90= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=AaEDv6vD; spf=pass (imf26.hostedemail.com: domain of 32MpSYwoKCNkEOCJPBCOJIBJJBG9.7JHGDIPS-HHFQ57F.JMB@flex--jthoughton.bounces.google.com designates 209.85.210.73 as permitted sender) smtp.mailfrom=32MpSYwoKCNkEOCJPBCOJIBJJBG9.7JHGDIPS-HHFQ57F.JMB@flex--jthoughton.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666370636; a=rsa-sha256; cv=none; b=hxeLg/nuecRb/UHBubcIClFlRLxd0vmpKoTUajEv84e4K4dFZLBZpjU055whU5m0xQLmXN 1qpYcB0dv4tzJcLrpAwH8J7DVOMZ5VbKrwSlfDd/82sE0P7XEoZ8033i3OtYlms6Um1mXp Nb4T1PeJ+ogrlzi4Yia+54Bw4FmpSok= X-Stat-Signature: f8ggpj6uo5w8yho5imhd6w6gychtommb X-Rspam-User: Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=AaEDv6vD; spf=pass (imf26.hostedemail.com: domain of 32MpSYwoKCNkEOCJPBCOJIBJJBG9.7JHGDIPS-HHFQ57F.JMB@flex--jthoughton.bounces.google.com designates 209.85.210.73 as permitted sender) smtp.mailfrom=32MpSYwoKCNkEOCJPBCOJIBJJBG9.7JHGDIPS-HHFQ57F.JMB@flex--jthoughton.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: D78FF14003B X-HE-Tag: 1666370636-817375 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
hugetlb: introduce HugeTLB high-granularity mapping
|
expand
|
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 8dba8d59ebe5..bb0005d57cab 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6154,6 +6154,11 @@ vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, mutex_unlock(&hugetlb_fault_mutex_table[hash]); migration_entry_wait_huge(vma, &hpte); return 0; + } else if (unlikely(is_hugetlb_entry_hwpoisoned(entry))) { + hugetlb_vma_unlock_read(vma); + mutex_unlock(&hugetlb_fault_mutex_table[hash]); + return VM_FAULT_HWPOISON_LARGE | + VM_FAULT_SET_HINDEX(hstate_index(h)); } /* PTE markers should be handled the same way as none pte */
Because hwpoison swap entries may be placed beneath the hstate-level PTE, we need to check for it separately (on top of the hstate-level PTE check that remains). Signed-off-by: James Houghton <jthoughton@google.com> --- mm/hugetlb.c | 5 +++++ 1 file changed, 5 insertions(+)