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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12866C47404 for ; Wed, 9 Oct 2019 20:21:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BDB7E206BB for ; Wed, 9 Oct 2019 20:21:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="UpSNO8QC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BDB7E206BB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 621E48E0003; Wed, 9 Oct 2019 16:21:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5D3836B0005; Wed, 9 Oct 2019 16:21:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E7238E0003; Wed, 9 Oct 2019 16:21:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0156.hostedemail.com [216.40.44.156]) by kanga.kvack.org (Postfix) with ESMTP id 2D2DA6B0003 for ; Wed, 9 Oct 2019 16:21:13 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id AD01A1EF1 for ; Wed, 9 Oct 2019 20:21:12 +0000 (UTC) X-FDA: 76025365584.01.stage44_44a9b373aa121 X-HE-Tag: stage44_44a9b373aa121 X-Filterd-Recvd-Size: 6219 Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Wed, 9 Oct 2019 20:21:11 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id a22so3863811ljd.0 for ; Wed, 09 Oct 2019 13:21:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GlgeX0Ygqdnp378F8QBhg6BFeJvuPAg5XojAuf1oJ2g=; b=UpSNO8QCClf9VcHjWM0Hjwto0+28wfNusUT00UXUQBjAmHOaa9HxF7bKTwbsA/vdE3 NkRabkO+gobWSgMKvzL3uaBbwmDIJ5WFNwn4+/XpWySL+IwoDBhr4sVWyZTypkSLiMCA A/pO07zlE5BkaMfmai5ehv3kry48PHPYcjaUM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=GlgeX0Ygqdnp378F8QBhg6BFeJvuPAg5XojAuf1oJ2g=; b=lNwku0BPjYNkCitU4gbELWsJ40Oa9jPhni/h2qhzqR0f2B4ewYMWR6oQUgquSKITr+ m1eyzPil5RjlvvcRkH88IhVCiqTPPTEA7mPU4WrLNVIdr+83nJQ7L2N1jPZBSmoDCkCd +sLRkOUPMFXlDDvJpzfJUGwhGF9c8Ju+La62LJD6/gaFvxW2u7rdAYxZMOmLLSVjOWfT TDHH/ZA2KuZGnomrs61vto6WryTpc1uSOrPAnXyuNgHCINzNqP5+Ww2Zy3hUDL/CH6uP 21JicfS5s+OeoqEuVCple30aLp2ZfYN64DIBa0u5HGdOMqcvXZDWHgtbpLYCFYRyPmQN P7tA== X-Gm-Message-State: APjAAAWzkMKPguiMDzrtvnluFOwj2V0KM5HC247djyJBTkR1+4CB426c 5hhdLoU317ut28nJjAtrVTLhIG32JXc= X-Google-Smtp-Source: APXvYqzOJ8uWktCr1nGpGLnBzXKnp3u/+NRoummPp0ZH05aKG6cWRFfBBtbAzqH1PmshLusFp7DKsg== X-Received: by 2002:a2e:9b8a:: with SMTP id z10mr3501285lji.66.1570652469603; Wed, 09 Oct 2019 13:21:09 -0700 (PDT) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com. [209.85.167.47]) by smtp.gmail.com with ESMTPSA id h10sm686774ljb.14.2019.10.09.13.21.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Oct 2019 13:21:08 -0700 (PDT) Received: by mail-lf1-f47.google.com with SMTP id u28so2636207lfc.5 for ; Wed, 09 Oct 2019 13:21:08 -0700 (PDT) X-Received: by 2002:a05:6512:219:: with SMTP id a25mr3299222lfo.61.1570652467845; Wed, 09 Oct 2019 13:21:07 -0700 (PDT) MIME-Version: 1.0 References: <20191008091508.2682-1-thomas_os@shipmail.org> <20191008091508.2682-4-thomas_os@shipmail.org> <20191009152737.p42w7w456zklxz72@box> <03d85a6a-e24a-82f4-93b8-86584b463471@shipmail.org> In-Reply-To: From: Linus Torvalds Date: Wed, 9 Oct 2019 13:20:51 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present To: =?UTF-8?Q?Thomas_Hellstr=C3=B6m_=28VMware=29?= Cc: Thomas Hellstrom , "Kirill A. Shutemov" , Linux Kernel Mailing List , Linux-MM , Matthew Wilcox , Will Deacon , Peter Zijlstra , Rik van Riel , Minchan Kim , Michal Hocko , Huang Ying , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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, Oct 9, 2019 at 1:06 PM Thomas Hellstr=C3=B6m (VMware) wrote: > > On 10/9/19 9:20 PM, Linus Torvalds wrote: > > > > Don't you get it? There *is* no PTE level if you didn't split. > > Hmm, This paragraph makes me think we have very different perceptions abo= ut what I'm trying to achieve. It's not about what you're trying to achieve. It's about the actual code. You cannot do that > - split_huge_pmd(walk->vma, pmd, addr); > + if (!ops->pmd_entry) > + split_huge_pmd(walk->vma, pmd, addr); it's insane. You *have* to call split_huge_pmd() if you're doing to call the pte_entry() function. I don't understand why you are arguing. This is not about "feelings" and "intentions" or about "trying to achieve". This is about cold hard "you can't do that", and this is now the third time I tell you _why_ you can't do that: you can't walk the last level if you don't _have_ a last level. You have to split the pmd to do so. End of story. > I wanted the pte level to *only* get called for *pre-existing* pte entrie= s. Again, I told you what the solution was. But the fact is, it's not what your other code even wants or does. Seriously. You have two cases you care about in your callbacks - an actual hugepmd. This is an ERROR for you and you do a huge WARN_ON() for it to let people know. - regular pages. This is what your other code actually handles. So for the hugepomd case, you have two choices: - handle it by splitting and deal with the regular pages: "return 0;" - actually error out: "return -EINVAL". There simply are no other choices from looking at the users you added. > Surely those must be able to exist even if we don't split occasional huge= pmds in the pagewalk code? And I told you how to handle that case when you eventually hit it. But that is immaterial. Because it's not what you actually do right now. Right now you have a huge WARN_ON(). Linus