Message ID | 20230105101844.1893104-2-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 791A9C3DA7A for <linux-mm@archiver.kernel.org>; Thu, 5 Jan 2023 10:18:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C9E9E8E0003; Thu, 5 Jan 2023 05:18:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C4E618E0001; Thu, 5 Jan 2023 05:18:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B16118E0003; Thu, 5 Jan 2023 05:18:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 9F8ED8E0001 for <linux-mm@kvack.org>; Thu, 5 Jan 2023 05:18:55 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 781CFA32F9 for <linux-mm@kvack.org>; Thu, 5 Jan 2023 10:18:55 +0000 (UTC) X-FDA: 80320347030.27.C410A8A Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf30.hostedemail.com (Postfix) with ESMTP id DB8448000B for <linux-mm@kvack.org>; Thu, 5 Jan 2023 10:18:53 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="e5/xp7qt"; spf=pass (imf30.hostedemail.com: domain of 3DaS2YwoKCFQ5F3AG23FA92AA270.yA8749GJ-886Hwy6.AD2@flex--jthoughton.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3DaS2YwoKCFQ5F3AG23FA92AA270.yA8749GJ-886Hwy6.AD2@flex--jthoughton.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672913933; 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=hd7V91rscRPZFZZvxWy710h4affBEizLA7fDXt78Shk=; b=TplhtaxlyoaK27nbbiPtQE/cvNQD5y6ycyxgqMeJy08/43UQ3LKt+OYH+0ubEwa3jIFTpy uO+ypEhumLkSzBJlDwlNyUAn8ydMzWPSpoQqINFG43z/6b/GM3Vqtcn0HslM47bJPLEstv 8EKzrS4Qhp9j4gZ5l8DlugRN54qUVAU= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="e5/xp7qt"; spf=pass (imf30.hostedemail.com: domain of 3DaS2YwoKCFQ5F3AG23FA92AA270.yA8749GJ-886Hwy6.AD2@flex--jthoughton.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3DaS2YwoKCFQ5F3AG23FA92AA270.yA8749GJ-886Hwy6.AD2@flex--jthoughton.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672913933; a=rsa-sha256; cv=none; b=eF8aRxH/7ick+cLRAEPTRcYvhC9SLS7ncHwhU8/FT8LytRisZ9ObC7EMnTx3g702fBcpM+ nPFi9WpTOOsQDvrXDaRySEGoKj0xhDzYt7ANqyQOcl1XKeTwz7USu8TDdTwzKYxxpGnNff pBYyd4VHVSxO+22RIly0ZwaEZ364BQw= Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-4ad7a1bd6f4so86472297b3.21 for <linux-mm@kvack.org>; Thu, 05 Jan 2023 02:18:53 -0800 (PST) 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=hd7V91rscRPZFZZvxWy710h4affBEizLA7fDXt78Shk=; b=e5/xp7qtQB20h9zFT5hG8PhvybXKj9xDQ+Q32FSU+DoEcADv55QGkwnSACPjQG/DyG vSRBq0IQ2N16x9PTtjdsbMAthbWAIxsOWG8qTqMi3fOpGsCfnEzbWtwY/ftO7/Aww8UO QDPnn5bU281BREv8ROjgTb6/jrQ4xdaIwAXCflIgBhVPfKKsCUqvAx6332vM6h13gOZT 9fP/e7Jwx/iB0gVJpzSXmMLjDIxvFvGjRhbP16hT207hdtIUzqTLLWx1ltXn2+FmtM24 IuRG4pS+ekNQ8KYf+xVb4krM3ZYDVnIAUyYIxI4L+mJmziZTbCp7hnTBs60V1VSV/eHb UOjA== 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=hd7V91rscRPZFZZvxWy710h4affBEizLA7fDXt78Shk=; b=l4Jk8Ug/gvXdqD7eLoa2BMVavEB8H92z/z7YhTOckn7C4ovEbtTOy1GXEwSa1ingI2 vS0JGqzOj1CyaN2EIiFHr9IvdHOEjjuP8zfApNm3a4GcmajIaEAoQA/G7GR7qYLfzG6E 3/dGCKZOjpyg8HP5YHVn4hnubTvha6H6m0zOmQJOukQb2EJjACdRzDCOcI+RUJdgu9Ix eTT0QefpgB3dZY4YaEiX70vvgC6k9ZWkOXBGAomZ8uBIGrGNUspXZzQ9LuoDY41oEj6l tPaK4rn/+rj+x2kME1Mi8aw7V/2ijt4S60S/caRoBzf+Q7PE8/1/pzVIaByPHYJ+XQvf aXug== X-Gm-Message-State: AFqh2krCWgn/ojKnjtD3fqlY126NUnqcdHY4F7kvegwFRokbLOrwEHcR 9DubIft1RF+Bo8u4LQT40a4dFCpkcSmUXo36 X-Google-Smtp-Source: AMrXdXstw/w8uZgrnirlc8KaHhFpJGRLW/TRlHyKxIB3cggFw/eFDgOY+owXrL+9vF5tHSEWgJCdm1gzsJeripRO X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a0d:ccc2:0:b0:3c3:b17a:4255 with SMTP id o185-20020a0dccc2000000b003c3b17a4255mr7272761ywd.38.1672913933058; Thu, 05 Jan 2023 02:18:53 -0800 (PST) Date: Thu, 5 Jan 2023 10:17:59 +0000 In-Reply-To: <20230105101844.1893104-1-jthoughton@google.com> Mime-Version: 1.0 References: <20230105101844.1893104-1-jthoughton@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20230105101844.1893104-2-jthoughton@google.com> Subject: [PATCH 01/46] hugetlb: don't set PageUptodate for UFFDIO_CONTINUE 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" X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: DB8448000B X-Rspam-User: X-Stat-Signature: 3rd4p4pc9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3+WbnOucDChGnudGbVOVA88CQM07lvsxOBllsXLcdiO7nnjrumbc1T93lyunwmuS7/TAWrkhyZ/Laws1xrAfD0k7Z3/o2fFFzSKWjyvj3J/v+0EQCCDSWQsVoDbfAH03XiIvl18Tjb1vfHsjx/9gctwjajMr1NqtiWNh7ekzAbagKKjzcYiw6E3uaJ8NC49eFf7QljkbS1dNyP0GdHWyTOa1pveNwj0BUi2B/aX0Q1oeMppLic8Wk7H5A/C9RGg+6PqoyYnqMdE+JyQxy0qQgSTIAiFvDcVhVHqDbXB9oWC/KR4YRDx236K+K/h/jC5t8wMxy72ZhnPutnvUd1voyYF4XMde9wP1bVPrk70X/ldvDWwJf65Bff+Hy/SvXS3F6tCa5pUtwJbqGVL5/naQLtQSKI 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 |
Based on latest mm-unstable (85b44c25cd1e).
|
expand
|
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index b39b74e0591a..b061e31c1fb8 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6229,7 +6229,16 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, * preceding stores to the page contents become visible before * the set_pte_at() write. */ - __SetPageUptodate(page); + if (!is_continue) + __SetPageUptodate(page); + else if (!PageUptodate(page)) { + /* + * This should never happen; HugeTLB pages are always Uptodate + * as soon as they are allocated. + */ + ret = -EFAULT; + goto out_release_nounlock; + } /* Add shared, newly allocated pages to the page cache. */ if (vm_shared && !is_continue) {
If would be bad if we actually set PageUptodate with UFFDIO_CONTINUE; PageUptodate indicates that the page has been zeroed, and we don't want to give a non-zeroed page to the user. The reason this change is being made now is because UFFDIO_CONTINUEs on subpages definitely shouldn't set this page flag on the head page. Signed-off-by: James Houghton <jthoughton@google.com> --- mm/hugetlb.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)