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=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 B5E2DECE58D for ; Wed, 9 Oct 2019 20:06:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 75EF021924 for ; Wed, 9 Oct 2019 20:06:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=shipmail.org header.i=@shipmail.org header.b="rnUqYRov" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75EF021924 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shipmail.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3E25F6B0003; Wed, 9 Oct 2019 16:06:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 394196B0005; Wed, 9 Oct 2019 16:06:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2846A8E0003; Wed, 9 Oct 2019 16:06:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0138.hostedemail.com [216.40.44.138]) by kanga.kvack.org (Postfix) with ESMTP id 091216B0003 for ; Wed, 9 Oct 2019 16:06:46 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 87166824CA36 for ; Wed, 9 Oct 2019 20:06:45 +0000 (UTC) X-FDA: 76025329170.13.car94_57db70fb1b841 X-HE-Tag: car94_57db70fb1b841 X-Filterd-Recvd-Size: 4645 Received: from pio-pvt-msa2.bahnhof.se (pio-pvt-msa2.bahnhof.se [79.136.2.41]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Wed, 9 Oct 2019 20:06:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by pio-pvt-msa2.bahnhof.se (Postfix) with ESMTP id 1245140283; Wed, 9 Oct 2019 22:06:37 +0200 (CEST) Authentication-Results: pio-pvt-msa2.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=shipmail.org header.i=@shipmail.org header.b=rnUqYRov; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se Received: from pio-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (pio-pvt-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HgnOJi0KOPz9; Wed, 9 Oct 2019 22:06:34 +0200 (CEST) Received: from mail1.shipmail.org (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) (Authenticated sender: mb878879) by pio-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id 12D363FC34; Wed, 9 Oct 2019 22:06:32 +0200 (CEST) Received: from localhost.localdomain (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) by mail1.shipmail.org (Postfix) with ESMTPSA id 64CEC36016C; Wed, 9 Oct 2019 22:06:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1570651592; bh=vMGxm9pZDwGkNVJyzKKG8CHgzWvHnRo9CbPaujwY7dI=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=rnUqYRovvZ2i8GbdNSe5v6n5CIMlncF95E2mKDseexkW7r9I4LnOfhZU4ee/Dq/3O F3FMKMWMCkaUpqF/vbTSvXt4ggbt3+qS9vmuH1lEraRg+WGpNk0rgetaHI8LqBWjUT jF1UrexXsFRHgQWCw39+t+RQgA4Wim6ms/1HqdZU= Subject: Re: [PATCH v4 3/9] mm: pagewalk: Don't split transhuge pmds when a pmd_entry is present To: Linus Torvalds , Thomas Hellstrom Cc: "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?= 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> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28VMware=29?= Organization: VMware Inc. Message-ID: Date: Wed, 9 Oct 2019 22:06:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US 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 10/9/19 9:20 PM, Linus Torvalds wrote: > > No. Your logic is garbage. The above code is completely broken. > > YOU CAN NOT AVOID TRHE SPLIT AND THEN GO ON AT THE PTE LEVEL. > > 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 about what I'm trying to achieve. I wanted the pte level to *only* get called for *pre-existing* pte entries. Surely those must be able to exist even if we don't split occasional huge pmds in the pagewalk code? > > So what you should do is to just always return 0 in your pmd_entry(). > Boom, done. The only reason for the pmd_entry existing at all is to > get the warning. Then, if you don't want to split it, you make that > warning just return an error (or a positive value) instead and say > "ok, that was bad, we don't handle it at all". > > And in some _future_ life, if anybody wants to actually say "yeah, > let's not split it", make it have some "yeah I handled it" case. Well yes, this is exactly what I want. Because any huge pmd we encounter should be read-only. /Thomas