Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1144189ybp; Wed, 9 Oct 2019 09:24:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLmtIrbML+RxvVgOOdtQyTvnUJQrqqAYlUO3H8pzjKEMpkeQHlIBcfebSQyKBaDP2IYu73 X-Received: by 2002:a17:906:7c57:: with SMTP id g23mr3676484ejp.116.1570638265596; Wed, 09 Oct 2019 09:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570638265; cv=none; d=google.com; s=arc-20160816; b=T/KsNR7CdTslAc0MpLlyMCqbokUQvRAUs1n+VG3SNddsAsAfNokLclQi8T7hbVHheH 7I70Qre9TznXAglnvVBBpDSqHxDmq2RJIneBIaHz/539WcWKLVJgPKNG+1Fvg9TEZuKQ xWhX8eGKuf1QS6CBX563Uh/7DVbwmdT3TlcWp7Oux1/6NfwNBfuHeIXVbFLlYq+EBc5F e+1jdLIk9W8N5QCYyRxpdSI5VB5ABYhulfkWIE8NnLp1lwML9OUAzV5yZqT0WLr9iYaP QgWEYMmBP6wmXfpG7lnEGQnDtVPUCghakuyPm+CilzKEn0+t2+6hHBHtx/5HFeKGCKl1 W4JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=irS7MxIYNB2GnGgL6wf/xO0qtWPCVd7suxRiO2KO4D4=; b=ym7a+Gj6Lq+AjoupiZN/JWJI799tyjklDDuGzwR94Q4bgdkc5sks4PQE5xouQkSDp+ eDlqwr8xc+Pe56/eIImkhgmMBWF+4L+4Bk93pmLTzdRWAcEdB76z8KGs0E867+xHb70j I4vTXUqEer/V26cXPZUDbtWvNEq4YtTT5n7ue+Wpn17hNDOJXDVSURXjtKEL/28EBlC5 nyZzflupv8fNTlAWtT6AitWGtY5TFFg+3DBNo1pgkRK+uaEDdbnm62i4fdzYLwDjTGFD MFT6/OkUYi1uSw8CagMsEcSt6cap62OaU6zn0UgyZunVhB2aHhjNjUmSmn2MT788w5XJ LKPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=hgOaZG0d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c60si1500426edd.327.2019.10.09.09.24.01; Wed, 09 Oct 2019 09:24:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=hgOaZG0d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731731AbfJIQV2 (ORCPT + 99 others); Wed, 9 Oct 2019 12:21:28 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:41361 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729644AbfJIQV2 (ORCPT ); Wed, 9 Oct 2019 12:21:28 -0400 Received: by mail-lf1-f68.google.com with SMTP id r2so2109441lfn.8 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=s7qNf92+8rGOw0CTPGshX55OfmaeOfOa7+icxWPft9EuMagAAZf/ZfPAKdYSNxJt+8 +Qlzk/AbjGQwf7wqM/TNVh81otUcbbaoVjcXenf0iMcEvsg56C/hYrNROGbusq9BfkEg K3vPGIe7yEAav8Bh7ectR3zDuguPLxdtumz265H1T3pxhuUjmquIoK8pMJUCAk+J2o2u ncdbh3e6pMKlvyoSrk1DvNNoBA5favPsaxlIbXi/3KZ3sJVK8WfYcMUZQhx5UJ+bRgZj BK/MU5Iv0oPH3Y4sImkuiB3whjpDs7kSHi8tHPLr6DL5hJz2WpnJQo+7mmqPdGuuXXZC vu5A== X-Gm-Message-State: APjAAAVzxZsd9zLN0me4+ZEIUaQ0MJWm8XDW0xGKAzITGMYoy4WU07XW IZ7bHWs9M4QQ+XAWRh5jeLhW0JH97vk= X-Received: by 2002:a19:4b8f:: with SMTP id y137mr2730491lfa.19.1570638086080; Wed, 09 Oct 2019 09:21:26 -0700 (PDT) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com. [209.85.208.177]) by smtp.gmail.com with ESMTPSA id g3sm561999lja.61.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-f177.google.com with SMTP id y23so3088426lje.9 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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