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 310C9C47404 for ; Wed, 9 Oct 2019 16:21:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C2376218AC for ; Wed, 9 Oct 2019 16:21:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="hgOaZG0d" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2376218AC 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 662148E0006; Wed, 9 Oct 2019 12:21:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5EACC8E0003; Wed, 9 Oct 2019 12:21:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4B4558E0006; Wed, 9 Oct 2019 12:21:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0153.hostedemail.com [216.40.44.153]) by kanga.kvack.org (Postfix) with ESMTP id 2C0AC8E0003 for ; Wed, 9 Oct 2019 12:21:28 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id D67E768B3 for ; Wed, 9 Oct 2019 16:21:27 +0000 (UTC) X-FDA: 76024761414.22.store60_cb582d85b84e X-HE-Tag: store60_cb582d85b84e X-Filterd-Recvd-Size: 4932 Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Wed, 9 Oct 2019 16:21:27 +0000 (UTC) Received: by mail-lj1-f196.google.com with SMTP id n14so3092244ljj.10 for ; Wed, 09 Oct 2019 09:21:27 -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; bh=irS7MxIYNB2GnGgL6wf/xO0qtWPCVd7suxRiO2KO4D4=; b=hgOaZG0duKaUR4d25pSryy7RdP9qviemEvzHvt19d0TSAxr0BfqQR3ZWYSTwR0r+9u i9iGymA9O3sH36uqhsrDUmdMcx0o8kfeXMJ8ye9WqAc6tizygENJM3wRYYfRkyG/AtPb 7SOGImdQZPDoEJKjK/Y9RwyexInoc9meO+hR0= 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; bh=irS7MxIYNB2GnGgL6wf/xO0qtWPCVd7suxRiO2KO4D4=; b=iE9eQVVVI/iiEbs7XAurOZjTtkFF/1RK3xCZJGgvpJxiW2gwZokbkNgcB2VO3Wj8Mv Nn287Ufd/sGkOoYj4aTZF30sSyi/6I+wuCg5TOT/vPy9rjABok9qjOyEOmQEkLo1ltI3 mZ07eYT6fIQUBrfL04OXEcvHzviX1K6Yuq1CwkJad5sm4yNd5KybfuQ5Mo3ai1xSnzxr PF0TaCr032J5U/GiqocRYSKvi4hK7o1F1FpPOxmUj651pzHQ8xgDL4Kl7peRsiCzfZ1D +MmvoMnBt9NBjh41Mn1EPAYkuWXiDXa6NNdOTmZETe/Uo3IohrVsywUOBP4gP/g58uQp TyPA== X-Gm-Message-State: APjAAAXmFpGHhuVJm1fYoissEZMQFh0cuwDOQy2j0h3D12+U193V/pdl hXSkajRLtcyhLgNFt9iBZDMIqsMXjc4= X-Google-Smtp-Source: APXvYqx4nCANYLRefbvqlGbcJegXUuxZ2GR/9gvEbb+GUU0f/CLFL48eYLKRyND1edUB14QVpI7smw== X-Received: by 2002:a2e:880e:: with SMTP id x14mr2882864ljh.42.1570638085773; Wed, 09 Oct 2019 09:21:25 -0700 (PDT) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com. [209.85.208.175]) by smtp.gmail.com with ESMTPSA id q16sm576601lfp.71.2019.10.09.09.21.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Oct 2019 09:21:25 -0700 (PDT) Received: by mail-lj1-f175.google.com with SMTP id v24so3140457ljj.3 for ; Wed, 09 Oct 2019 09:21:25 -0700 (PDT) X-Received: by 2002:a2e:8315:: with SMTP id a21mr2891882ljh.133.1570638084772; Wed, 09 Oct 2019 09:21:24 -0700 (PDT) MIME-Version: 1.0 References: <20191008091508.2682-1-thomas_os@shipmail.org> <20191008091508.2682-4-thomas_os@shipmail.org> <20191009152737.p42w7w456zklxz72@box> In-Reply-To: <20191009152737.p42w7w456zklxz72@box> From: Linus Torvalds Date: Wed, 9 Oct 2019 09:21:08 -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: "Kirill A. Shutemov" Cc: =?UTF-8?Q?Thomas_Hellstr=C3=B6m_=28VMware=29?= , Linux Kernel Mailing List , Linux-MM , Thomas Hellstrom , 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" 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 8:27 AM Kirill A. Shutemov wrote: > > Do we have any current user that expect split_huge_pmd() in this scenario. No. There are no current users of the pmd callback and the pte callback at all, that I could find. But it looks like the new drm use does want a "I can't handle the hugepage, please split it and I'll fo the ptes instead". > That's hacky. > > Maybe just use an error code for this? -EAGAIN? I actually like the PAGE_WALK_FALLBACK thing as more documentation than "it's an error, but not one you return", although I do detest the particular value chosen, which is just a nasty bitpattern. Maybe it could use an error value, just one that makes no sense, and is hidden by the PAGE_WALK_FALLBACK define, ie something like #define PAGE_WALK_FALLBACK (-ECHILD) or something like that. And I suspect the conditional would be cleaner if it was written something like if (!err) continue; if (err != PAGE_WALK_FALLBACK) break; err = 0; if (pmd_trans_unstable(pmd)) goto again; .. do the split .. and skip the WARN_ON() and the odd "non-zero but smaller than MAX test" Linus