Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1376036ybp; Wed, 9 Oct 2019 13:08:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhHhl5er7x7cXuQE9m8tpv4zwuERwIJQw4FXZ0qvvjVznl+ZX27kCEI17PnPkU0KdaLvjO X-Received: by 2002:a50:9a46:: with SMTP id o64mr4728832edb.191.1570651690510; Wed, 09 Oct 2019 13:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570651690; cv=none; d=google.com; s=arc-20160816; b=RW18F9s2p5L8BJ2Zacw+IAmIi18fCXvdzfufpQxERhENUW6At1GobxxwxnO7biJs3X uzAxENicLgRFlVvEvseeoZVLwNx/zEEmkih/a3M+pBXXA8xJQRsdht7+kWAjfFtQuBpC cq083R5I9ti+IXECmyGqKc1LTk2tpgoEqQVoXLMNVO6BJBOak7jIgwzztDHs9ovSEF1r khJvKpy6qbvnjYcbReQFk9TtrTTd+rg7lI3WzLEZNH0ruYkP93XzLkwVt5+pt22ipaTZ Y9jWv60cqKve9xnZHQhnKzJChLPa6j2FM0OVXpmjI7gQ8KrUuT8+QZh8MWwMubNyPZ+H xNlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=uxanmpsbyDHTzW58NoO82Fu3p4o5+mt5fiXWbCyNSvg=; b=aGgVQaTUsLXsxiocMWSqwVbVUoSxrOigSZN4M64uDfxrGspz2sPWahhBozMFNHaZqg tNSjh6BgIK5F3oaw/5qwKLsun1uEcUtKi7wq1xqDRLTmeqMDsqsP1e4TRoYzdU4Zl9Rn MO+J6iYk+QlbW1u9CIKzikzdcME/887q65m+sWMCfbKOCtSm1eaJgOKrZxFjSacYWmym OEBRBYx/zQb0Ot9u8wA0IOoR1c7liDP/QL5jkwE6Xy6GB8BXOtsr5hYmdt6Ul1s5gVVw /16iy4t0XIxxKKAOMwB9PJAKe7U4cJTJC8e4c1VxQY/T9uycg0sJ7C8bDGMMAuwbkOqZ 05fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@shipmail.org header.s=mail header.b=rnUqYRov; 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 r24si1794974edy.417.2019.10.09.13.07.46; Wed, 09 Oct 2019 13:08:10 -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=fail (test mode) header.i=@shipmail.org header.s=mail header.b=rnUqYRov; 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 S1731914AbfJIUGp (ORCPT + 99 others); Wed, 9 Oct 2019 16:06:45 -0400 Received: from pio-pvt-msa2.bahnhof.se ([79.136.2.41]:42398 "EHLO pio-pvt-msa2.bahnhof.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731452AbfJIUGo (ORCPT ); Wed, 9 Oct 2019 16:06:44 -0400 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 X-Spam-Flag: NO X-Spam-Score: -2.099 X-Spam-Level: X-Spam-Status: No, score=-2.099 tagged_above=-999 required=6.31 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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