From patchwork Wed Apr 3 01:32:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13614862 Return-Path: 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 62F2CCD1284 for ; Wed, 3 Apr 2024 01:33:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F10966B0087; Tue, 2 Apr 2024 21:32:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EC0326B0088; Tue, 2 Apr 2024 21:32:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D3AD96B0089; Tue, 2 Apr 2024 21:32:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id AE9026B0087 for ; Tue, 2 Apr 2024 21:32:58 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 7ACEC1C0D98 for ; Wed, 3 Apr 2024 01:32:58 +0000 (UTC) X-FDA: 81966496836.30.44CB373 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf10.hostedemail.com (Postfix) with ESMTP id 79D48C000F for ; Wed, 3 Apr 2024 01:32:56 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=SY6AX4Ij; spf=pass (imf10.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712107976; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UqFcRORApCbbLwHiV/NvWvcvg5AC7kP7mUGUslgtJS8=; b=p5G7W6N1mZsHZBdeeSjUuzsgqSqcKcTg9r7LzD+979WXVWpxrLx9vPLpOxkrGi8vFS3KJW msWA6OgOGPemMV5qejbCUjP3F4wyMlQaptvSy662rUPSHaUSE7aHJSuDD355J3VGistY/S oDSdMGCbR0HrqjWykz1FNxYS0RR/+dc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712107976; a=rsa-sha256; cv=none; b=dIkgmIQ8oqtYLCRnJecECHWkg6nQNOmO0UBJ31+uLqGq7ja3BZlQssf1sMRXZBbLMRWnLx VVVhdVzKF2JEEKbZXTvdU8x2LyY8zWINiP4ucd7MjwBrhi06adnS+oKIwVqy6PjdqoNXwX fiI64b0/+xAamGlzI8YEpPWc84rLFuU= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=SY6AX4Ij; spf=pass (imf10.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712107975; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UqFcRORApCbbLwHiV/NvWvcvg5AC7kP7mUGUslgtJS8=; b=SY6AX4IjOjJimQe8gDAgQI5wTphgDRV6VTtHnamBJKu55d/xBMUL3f86YAmBjijftq+/Ow b6iYKcflMjBzILLVet5LkaWENNNcbJyV5eMK2K8AE9L3siYWfExHDVhMaKSFZgvaXKrGpz nteXs9Jrdyam3rIYHNWW5yozWQ4ZZWY= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-311-ke7RIBtFNcme-ZzQXkXC0Q-1; Tue, 02 Apr 2024 21:32:54 -0400 X-MC-Unique: ke7RIBtFNcme-ZzQXkXC0Q-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-69925f44915so937346d6.1 for ; Tue, 02 Apr 2024 18:32:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712107974; x=1712712774; 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=UqFcRORApCbbLwHiV/NvWvcvg5AC7kP7mUGUslgtJS8=; b=DtP8bmYdGzZVx4a/2TaJYuhqty4pdjnsHaU16gZDAQsNOWUCFH3kZp9RdFa/50nRTa nd5VGhcqm0EQD11PGTgIxteAiZhbCqXF2wsnYo6FMGdFT6keINQZ1XU0BXYser8ENVoN 9JxxtNtjEOdVyC5fw2PCTSlchu5B335eQaJamB3q9Ct1Vi8dNNTwXAHMTO/IHyTJ0FSm e1dqsFOtZkbiK5uW+0+7ay2gmZiXSqZlrO0RnBbbqu9b3ngp8VdVSyjshEfBppeU6GE/ WPoIjUj/seVu4A4jLYxE8+5oyAolPcgXSNFmolsWcVYSahXtUJpvJbZynuwC/flBdlTL G1yg== X-Gm-Message-State: AOJu0Yxut96bFWd2sXJWGNHRWKVK2jj+GsP1t5CDij5YuBqDE6lqOunF +u1WcBOBfLqJ7ucQWdhpcB0UP0TLy329gj/vLaKWAB5lmymSW1TBnjJeq6Ps3UvMXaKoxr8bwiM IvuHzWpgyX8DGuFg/7Fkl6g8DCa4k+rDEHstGG+A4mjn4IdkdwzT/nxsfbKsAnOwnmECoyJ94Fq ryFRBA/1jZ2XPhhqr+UXE3NcBPZX2Hew== X-Received: by 2002:a05:6214:946:b0:698:ff21:99f6 with SMTP id dn6-20020a056214094600b00698ff2199f6mr9007664qvb.3.1712107973906; Tue, 02 Apr 2024 18:32:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFdeiJvxhuNcK+1vYTZU0OZ0cczYLrBalyCYqNCwtKHKX2kkX+lMyBxEcKCdgdQrvrdhUD2Gg== X-Received: by 2002:a05:6214:946:b0:698:ff21:99f6 with SMTP id dn6-20020a056214094600b00698ff2199f6mr9007637qvb.3.1712107973351; Tue, 02 Apr 2024 18:32:53 -0700 (PDT) Received: from x1n.redhat.com ([99.254.121.117]) by smtp.gmail.com with ESMTPSA id qm18-20020a056214569200b0068ff8bda6c7sm6031687qvb.92.2024.04.02.18.32.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 18:32:53 -0700 (PDT) From: peterx@redhat.com To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Huacai Chen , peterx@redhat.com, David Hildenbrand , Jason Gunthorpe , Nathan Chancellor , Andrew Morton , Matthew Wilcox , WANG Xuerui , Ryan Roberts , loongarch@lists.linux.dev Subject: [PATCH 2/3] fixup! mm/gup: handle huge pmd for follow_pmd_mask() Date: Tue, 2 Apr 2024 21:32:48 -0400 Message-ID: <20240403013249.1418299-3-peterx@redhat.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240403013249.1418299-1-peterx@redhat.com> References: <20240403013249.1418299-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Stat-Signature: k83szdtkfgym5xwtq7dd91fygjnib43r X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 79D48C000F X-Rspam-User: X-HE-Tag: 1712107976-400815 X-HE-Meta: U2FsdGVkX18zf3gNGHONMOTlPOFrB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5lWfSVQjnH/gpPivlR26ILcL9tpwloMTGgzle68pFOb5ytywxQsG3pq2NqVQ/IaiMdVwUnyY+AkGu8HWRvgmqckz64JDkLYoxFQMMi8q1EhGGjelaXe9fterapMtvQkMawzqCxyHLGbEvdTpB4xbZPpoGW43qT026MEnFQ/2zzXni+gj6klEfGRT94Vxz6DwMwNpOt7sbFu2y3Qkaz8Gw2kazlRQA8aNHc1Uxuyd9VkV+HGMG/JpMP7+9aKG1C7pVKa0q6PqJ6OfCUnXHqaNdtE0d2ObmLJKaAFoZCisqhg9BbnSLA3+mEV9oYeC5OS0/M/joXokjVIPWokq7seW8zn5B0iAIZ/+HSMzAjVyfJPEWkXB2Nu9s5nCtIPaCH1+qCUbwDKQ3dPP3RWalANLUufJwC2LkX/9a9aHtsdAAwxmBaIPg== 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: List-Subscribe: List-Unsubscribe: From: Peter Xu Allow follow_pmd_mask() to take hugetlb tail pages. The old warnings do not help now as hugetlb now allows it to happen, so drop them. Reported-by: Ryan Roberts Signed-off-by: Peter Xu --- mm/gup.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 91d70057aea0..d60b63fcfc82 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -775,8 +775,6 @@ static struct page *follow_huge_pmd(struct vm_area_struct *vma, assert_spin_locked(pmd_lockptr(mm, pmd)); page = pmd_page(pmdval); - VM_BUG_ON_PAGE(!PageHead(page) && !is_zone_device_page(page), page); - if ((flags & FOLL_WRITE) && !can_follow_write_pmd(pmdval, page, vma, flags)) return NULL; @@ -805,7 +803,6 @@ static struct page *follow_huge_pmd(struct vm_area_struct *vma, page += (addr & ~HPAGE_PMD_MASK) >> PAGE_SHIFT; ctx->page_mask = HPAGE_PMD_NR - 1; - VM_BUG_ON_PAGE(!PageCompound(page) && !is_zone_device_page(page), page); return page; }