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.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 24E03C2BA19 for ; Tue, 14 Apr 2020 11:33:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D76342072D for ; Tue, 14 Apr 2020 11:33:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VRrPqiVD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D76342072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 607128E000B; Tue, 14 Apr 2020 07:33:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B85B8E0008; Tue, 14 Apr 2020 07:33:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4CD8B8E000B; Tue, 14 Apr 2020 07:33:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0252.hostedemail.com [216.40.44.252]) by kanga.kvack.org (Postfix) with ESMTP id 306CC8E0008 for ; Tue, 14 Apr 2020 07:33:26 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id EA62F702 for ; Tue, 14 Apr 2020 11:33:25 +0000 (UTC) X-FDA: 76706249970.27.steel55_cfd8aa9ed2c X-HE-Tag: steel55_cfd8aa9ed2c X-Filterd-Recvd-Size: 4788 Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Tue, 14 Apr 2020 11:33:25 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id g2so4556499plo.3 for ; Tue, 14 Apr 2020 04:33:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=KZ+sHNUWTGOOngDZlWZuibRHv6pBV5xa/Uz2LHhglIw=; b=VRrPqiVD/QCxdjEBbskkY+yCiShEK6wsEIXtHjLXfpvij1ltRLBYW8NzIJJmPGw7Jl 7O9rXprSSg2KypN2/n22gPbfrV2ko9yTd5ZQA5X2LQDSyGFUWQu8QBnphH70gUe+/FRK 5/ysYWz68GwkQi8JYoDLAb1lhU/6pBp5yLlGMV7SiRr2jMJHGt/nW+uAjgiUYV7ycto8 eFxubCIicj7SXfgr/8LiQbyXdkpfNE6H1TDEa73cP7OLaDzRMX9MMI1VYP3Q3GlNdo69 gNWUpXzn33RucYnWizv9TVCwAa7EJYfdk5B6bGls6Fic9fwDW2teTKTU4yxceD2TRnfL dySQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=KZ+sHNUWTGOOngDZlWZuibRHv6pBV5xa/Uz2LHhglIw=; b=XJTwcolV5WH7rpYrWR9ooqwBGO4dhBkU9BmxqXXM9pId1gr2eeJLjI7WOrR0aKSUFz tdZh1TU9++rPgShs4gFo7klwoY2MWL6QZyS68uYzTR3uChrb4l5R7isYAafx+CL2LG4e wkM9Qhb+DfBYs0qsmUTKltqqsmr8GZmKXgcpYySJSu33OctMQe+h/OeVALAAP/A8Pzb2 u2+sa5Apnc6vh6gf37m/fqQN8XScNI5HBbTcNztHg/kn2LDJNogM8EkycHkwBQJFwXB5 LA/mkdMrUKrMuyiT+Fv5QfQ9mIHGrPeZ5V8A0wjYDyXohVoockphNnEEAl8WsqaYksSk ZmPg== X-Gm-Message-State: AGi0PuZGPE1EjbUN3PJ/3s3i5rCJ1S87I1wZ4/Gs43W1Gty02vKhBklf c/Kidkjm3VXfas2R5xjLrpE= X-Google-Smtp-Source: APiQypIcyr6/I0Kkbv3wlFcU4/Xr/0wS9p1hSr/PXKwlPWpCeFL0ysIODdUC3n5T/abK9CdK/6LdFA== X-Received: by 2002:a17:902:6a88:: with SMTP id n8mr21744267plk.292.1586864004572; Tue, 14 Apr 2020 04:33:24 -0700 (PDT) Received: from localhost ([203.18.28.220]) by smtp.gmail.com with ESMTPSA id w2sm11023334pff.195.2020.04.14.04.33.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 04:33:23 -0700 (PDT) Date: Tue, 14 Apr 2020 21:31:49 +1000 From: Nicholas Piggin Subject: Re: [PATCH v2 1/4] mm/vmalloc: fix vmalloc_to_page for huge vmap mappings To: Matthew Wilcox Cc: Borislav Petkov , Catalin Marinas , "H. Peter Anvin" , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, Ingo Molnar , Thomas Gleixner , Will Deacon , x86@kernel.org References: <20200413125303.423864-1-npiggin@gmail.com> <20200413125303.423864-2-npiggin@gmail.com> <20200413133444.GM21484@bombadil.infradead.org> In-Reply-To: <20200413133444.GM21484@bombadil.infradead.org> MIME-Version: 1.0 Message-Id: <1586863573.ufpx8o7f0i.astroid@bobo.none> 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: Excerpts from Matthew Wilcox's message of April 13, 2020 11:34 pm: > On Mon, Apr 13, 2020 at 10:53:00PM +1000, Nicholas Piggin wrote: >> vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. >> Whether or not a vmap is huge depends on the architecture details, >> alignments, boot options, etc., which the caller can not be expected >> to know. Therefore HUGE_VMAP is a regression for vmalloc_to_page. >>=20 >> This change teaches vmalloc_to_page about larger pages, and returns >> the struct page that corresponds to the offset within the large page. >> This makes the API agnostic to mapping implementation details. >=20 > I'm trying to get us away from returning tail pages from various > functions. How much of a pain would it be to return the head page > instead of the tail page? Well, this is a fix for the interface for HUGE_VMAP stuff so it doesn't really make sense to change the implementation here. If you want to change or make a different API that would be a later patch, no? > Obviously the implementation gets simpler, > but can the callers cope? I've been focusing on the page cache, so I > haven't been looking at the vmalloc side of things at all. Well callers that operate on ioremap today (and vmalloc tomorrow) won't cope, because they're expecting a base page. If you wanted to change it I suspect the way to go would be introduce a new function and move everyone over individually. Thanks, Nick