From mboxrd@z Thu Jan 1 00:00:00 1970 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 F0A35C43334 for ; Wed, 20 Jul 2022 20:28:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5B4836B0072; Wed, 20 Jul 2022 16:28:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 564DB6B0073; Wed, 20 Jul 2022 16:28:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4049C6B0074; Wed, 20 Jul 2022 16:28:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2D75A6B0072 for ; Wed, 20 Jul 2022 16:28:34 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E20DCA05B2 for ; Wed, 20 Jul 2022 20:28:33 +0000 (UTC) X-FDA: 79708616106.05.5F0376C Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) by imf12.hostedemail.com (Postfix) with ESMTP id 9038840011 for ; Wed, 20 Jul 2022 20:28:31 +0000 (UTC) Received: by mail-qt1-f176.google.com with SMTP id r21so13553397qtn.11 for ; Wed, 20 Jul 2022 13:28:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=70hOk9fQAeNRqfVwyCLPAhMnbrFabZMtO1C8AUbAD6E=; b=fa5qMMNjkja8Lc4uBK+Spvcmq4elg/7PJL8EgkAxW2X6LmcuMAsTXqfiuouxnY8LgG vKJ0H7vFkCurp3XKbjzaCF4fJ88FlrKc6L2jX2PpOCTosOENTH7/uw2P4QekOzCJtaHK wWminMovvJJKDUJTpaKk9JLc0yfeiMXt470WZ0ZuHNUzq0CXq73aMJDoJ1gFgqktDih6 QB254gcWp3sTx06Ny/c9fFnseYhMjVH3rpjJhFhZieV7b5yUjzSl2hwKgHGyHWUvqH2m Wrfo1Vh9L5/8jjsv/oszUZM5NTC1lkP2y1INZryr/m0W9PdwvihwdMPRZmUlrzdW/07v pusA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=70hOk9fQAeNRqfVwyCLPAhMnbrFabZMtO1C8AUbAD6E=; b=A1otcBH/tcxbj1xT6oPNtiRR1gIYd24+dswyt7lzKwhSlqIheNM5WNIXBKWnqegoPN uGvmRqY15dhlGTLCt35TDzxgTn/Or20WmbHD2gxKfeZBad0G5VP/1sPJhQYiYYKd288N P8AjQ2hL25jd9iCAe54PhkMIH3RtoZYLMkh74PeaWYnkq8fD2647by/EmwTx32319xFy aNN83NKG6QMKUCJ+iW3x2qzVeZks+quN/63VfjdR7KMHmzWGTwyEJYZZvw9gVW8QBNvo UBmW37M/WT3Al4Do3WJtMb6Dfr9XxWzBmFznlU7Q86Uha1H6DgsN4NVWMwhPUVyXzFCu gzcw== X-Gm-Message-State: AJIora9Wbso6pIgppD3ExD4K4IxtGCeSM07sKDSacxPACZAH+JOs/6+2 iVkm5h8BNV7C+WS3wzr5zQrPhA== X-Google-Smtp-Source: AGRyM1tqkAaNGOKwOTAzgmHK4mvx9DgE658Omz5lCTod1793QikLrHn1KxlEkv29CTNp+cuea8J7qg== X-Received: by 2002:a05:622a:1756:b0:31e:ef69:f1aa with SMTP id l22-20020a05622a175600b0031eef69f1aamr13101027qtk.422.1658348910676; Wed, 20 Jul 2022 13:28:30 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id d17-20020ac81191000000b0031ee3449f34sm47176qtj.86.2022.07.20.13.28.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 13:28:30 -0700 (PDT) Date: Wed, 20 Jul 2022 13:28:10 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: Zach O'Keefe cc: Yang Shi , Andrew Morton , "Liam R. Howlett" , Linux MM , Hugh Dickins Subject: Re: [PATCH mm-unstable] Revert "mm/khugepaged: remove redundant transhuge_vma_suitable() check" In-Reply-To: Message-ID: <2199323-7463-3eb6-63b-68e2fcf23d72@google.com> References: <20220720111318.1831708-1-zokeefe@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=fa5qMMNj; spf=pass (imf12.hostedemail.com: domain of hughd@google.com designates 209.85.160.176 as permitted sender) smtp.mailfrom=hughd@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=1658348911; 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=70hOk9fQAeNRqfVwyCLPAhMnbrFabZMtO1C8AUbAD6E=; b=caEj/Vx25rcnwrHd85WfT+4sXpBaeNFd2h7GSruG/37Qbp7iayCS9PG2MRcqIZmKeF4WK5 AkChKKJA1tX1Kd2FZldivpYRZnJmI1RU0lUzY7E9Sli5MiEB6hqKu0jhQ3C41fdEZy9pqF nTedQsqcJXLUG+83eHGf4N1IL08x41E= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658348911; a=rsa-sha256; cv=none; b=cKg42OsOe1qpRTVHSbBAAwYogVnx4tstWf7s2aAy405FfZ0uymQJch34MYtjJE9ECGKXPY NlVqcZH2pRCEs6PiKEPYJ3rcarPpDVu6HI9lHtpK9CP/cNAaUqaRxFuM3LgFRrh1yr7T+/ Syl8NhdikBEMn9nL29Ho0eskkF4lmpI= X-Rspam-User: X-Rspamd-Queue-Id: 9038840011 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=fa5qMMNj; spf=pass (imf12.hostedemail.com: domain of hughd@google.com designates 209.85.160.176 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: yimqt8ik138bfmp9i1c56tsphhmprrtd X-Rspamd-Server: rspam07 X-HE-Tag: 1658348911-714878 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: On Wed, 20 Jul 2022, Zach O'Keefe wrote: > On Wed, Jul 20, 2022 at 10:22 AM Yang Shi wrote: > > On Wed, Jul 20, 2022 at 4:13 AM Zach O'Keefe wrote: > > > > > > A pmd should not cross a VMA boundary, which is normally enforced by > > > vma_adjust_trans_huge(), and assumed by e.g. __split_huge_pmd_locked(). > > > > > > In this regard, the transhuge_vma_suitable() check in > > > hugepage_vma_check() is not redundant with the transhuge_vma_suitable() > > > check previously in hugepage_vma_revalidate(). > > > > > > The former validates the VMA itself, and checks that *some* memory > > > in the VMA is suitable to collapse while the latter validates if > > > collapsing at a specific address is suitable. By removing the check on > > > the faulting address, we've inadvertently allowed collapse of a pmd that > > > can cross vma->vm_end. Revert this change. > > > > Aha, yeah, nice catch. > > > > Reviewed-by: Yang Shi > > > > Thanks Yang. Also, hughd found it :) In hindsight, I think it's > actually customary to add a "Reported-by: Hugh Dickins > " - but since the previous patch will just be > dropped and never see the light of day, I guess the value there is > diminished. Anyways - credit goes to Hugh :) Thanks Zach, no probs, and as you say it would have vanished anyway. It was something I hit in testing maple tree, and at first thought a consequence of maple tree's (previous) brk handling: https://lore.kernel.org/linux-mm/a6736ccf-fb45-5777-ca28-575297f1879f@google.com/ (the "coincident" paragraph). But a similar crash occurred when I took that out of the picture: maple tree not to blame at all - apology to Liam. Hugh