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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17EB9C32771 for ; Fri, 19 Aug 2022 15:45:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2CE678D0003; Fri, 19 Aug 2022 11:45:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 27CDC8D0001; Fri, 19 Aug 2022 11:45:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 16BC48D0003; Fri, 19 Aug 2022 11:45:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 049BD8D0001 for ; Fri, 19 Aug 2022 11:45:17 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D1ED8C02E0 for ; Fri, 19 Aug 2022 15:45:16 +0000 (UTC) X-FDA: 79816766232.25.08DD43E Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP id C908180140 for ; Fri, 19 Aug 2022 15:45:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=tw8kEMFFRbBUwts1QbL1tM2Tys2mNEpVsw+0+Hm+CxY=; b=RDtZCUrmOidmw/y4ynTuLO+0Sn Zv48f5Lcj2dW89zvMD3NRf861BK1XCYeE/gbbLaXBE/4JWgE0k0ghvOWDmD6P2R8eDwELBO08QTZR FC6iaja7ELLoNxLT3JMrlK3ZiN4gxblk8oUUGqD9hedu5BnQ7f2IC/qSdk0IOgfAYy1wVwhUeTNvr cyIXoGI+vKu3QJ2bh0tF8oIWRiu4hFv6KJyKB4IlsCLUfv5NTTFLrYYH7WKB11kLjVpmFgUPBGOtU NR2JoHv6MiouKLByKQDqzDq+2rhLapEpxlpptzXHMkbV6k9a1TFB8sHlQv8lrDyD7n7PtOwPZdyHj nMW1BeBA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oP4BF-00BJ1L-GL; Fri, 19 Aug 2022 15:45:05 +0000 Date: Fri, 19 Aug 2022 16:45:05 +0100 From: Matthew Wilcox To: Uladzislau Rezki Cc: Thomas Gleixner , Ira Weiny , "Fabio M. De Francesco" , Luis Chamberlain , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC] vmap_folio() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660923916; a=rsa-sha256; cv=none; b=2HvuwZ8mXuqa5m+4NJnIqDgx8QysEQ1Md32o6lhxiXICnENRsnSs3OrpUHC397zmRqff2U dbdxShxvEN1pJdI/mnIQTOl9lfLlz7JAJPV8ajJJglG8va0lkS6+HNSfyWIDSkpaIGwqXi 3fJdCzMaCldzHFI1Qvmwhj6aH1NyE2I= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=RDtZCUrm; dmarc=none; spf=none (imf30.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660923916; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tw8kEMFFRbBUwts1QbL1tM2Tys2mNEpVsw+0+Hm+CxY=; b=5ZtDXyKXsg7b5ewCfbLGzhWXeFiFg7CYL0kVff63ow7bKQ1wkFOnint/OFixOHGid7SGJo pzk79ah7B9Okvhf57pq9m3gzQGLMXRlxcUyf5Cxuqu9ViWGtXBD3ZkcJfxbKXGBVEc0oKm GAIsvNV1sWHzyhzliGmWqDAWncM26V0= X-Rspamd-Server: rspam06 X-Rspam-User: X-Stat-Signature: f6yzj15rw6emyd5mx45ndf6x5fegyr8c Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=RDtZCUrm; dmarc=none; spf=none (imf30.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Queue-Id: C908180140 X-HE-Tag: 1660923915-354003 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 Fri, Aug 19, 2022 at 12:53:32PM +0200, Uladzislau Rezki wrote: > Looks pretty straightforward. One thing though, if we can combine it > together with vmap(), since it is a copy paste in some sense, say to > have something __vmap() to reuse it in the vmap_folio() and vmap(). > > But that is just a thought. Thanks for looking it over! Combining it with vmap() or vm_map_ram() is tricky. Today, we assume that each struct page pointer refers to exactly PAGE_SIZE bytes, so if somebody calls alloc_pages(GFP_COMPOUND, 4) and then passes the head page to vmap(), only that one page gets mapped. I don't know whether any current callers depend on that behaviour. Now that I look at the future customers of this, I think I erred in basing this on vmap(), it looks like vm_map_ram() is preferred. So I'll redo based on vm_map_ram().