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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EBDBC433F5 for ; Mon, 18 Oct 2021 18:12:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D53106128E for ; Mon, 18 Oct 2021 18:12:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D53106128E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 51835900003; Mon, 18 Oct 2021 14:12:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C8A3900002; Mon, 18 Oct 2021 14:12:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3B6B9900003; Mon, 18 Oct 2021 14:12:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0170.hostedemail.com [216.40.44.170]) by kanga.kvack.org (Postfix) with ESMTP id 2BCDC900002 for ; Mon, 18 Oct 2021 14:12:39 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E2E9E39B26 for ; Mon, 18 Oct 2021 18:12:38 +0000 (UTC) X-FDA: 78710353596.02.98004B3 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by imf30.hostedemail.com (Postfix) with ESMTP id BCA5FE001989 for ; Mon, 18 Oct 2021 18:12:34 +0000 (UTC) Received: by mail-qt1-f178.google.com with SMTP id y11so16018367qtn.13 for ; Mon, 18 Oct 2021 11:12:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=T1Y3hHjwpzUobNasEmJ1LbasYmT06ZrBoRVnLfQhAR0=; b=M+cYLFsQXMKBe086tLn8JKibWU7uGMqGxweAf+1IjkR7vkaR7gUvY8j8IcMMkrhAHU DXGYfSNzfByM+RS26Y3tpMBsO1dLWZKcJi+4lxVein2GeoZ8xpWClxKvBeuNsxCtSox3 gFj4XIxPkiu2GqEF3jLjlY154pNJzItqCqSdqnnTQVGLQ08IiCzc5gpvU2qxdcnBkHXu GJUpy6jvXE8s9cj/ufGQ3Pe2q1zsOZByYnuG9t7Uyl+wfHNg+IC9qYL2w1+oY+OImXfC mv9ScOKfUtyhQAVb9T/pZhIhQNL4d9Q/+juXhmAPUY6y/G5NN1XZ3sddCbVoeXWRv0m5 3MNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=T1Y3hHjwpzUobNasEmJ1LbasYmT06ZrBoRVnLfQhAR0=; b=OLCLcLM6YFY/Lfxtc0gxMoRlkjFlgQsyKmK6cNFhMtYYp9AceuDS9ouBUqFE0mxu5E cO9ccRF3DCiDsAZJ0iUqxRfWpIUiuSi4T/J7yGGpZKpS+KDmwQ/7jFET8sraUPVQSMaH zu6ByXh5BEd3tp3THPfrkAWCS7ZTCuCThCfThaDgWYSds3yjNiWr7QEf9+EjxC9hIeme 5Xxx4ZMO8xBpEkvSS5oVYRJm9uueU0ohDZvoI3Jl7KqxWLq5r/NqzQ7DWQLGeh9GmtpZ 7P/C+gCrGNf8L4sRW9V07gEdCrCw6maVjkjH6Dm2gpiOeFEQOS98L4IisFGNnB13879t CHNw== X-Gm-Message-State: AOAM533XYyNCZe5amO2yyOFOoHw0l/6M25ppmwHMrFJ2XzVLoDkgf+nd D4TGs1q06NxD62MZhCQ53g== X-Google-Smtp-Source: ABdhPJzUSAstoRyubIgeefnb4femxE5bBe7p0XNGuQ2TVeRfMhaLCl1FD1hyifZJ8eapRdC/tlf1Gw== X-Received: by 2002:a05:622a:252:: with SMTP id c18mr31616513qtx.96.1634580757766; Mon, 18 Oct 2021 11:12:37 -0700 (PDT) Received: from moria.home.lan (c-73-219-103-14.hsd1.vt.comcast.net. [73.219.103.14]) by smtp.gmail.com with ESMTPSA id c5sm6704063qkm.10.2021.10.18.11.12.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 11:12:36 -0700 (PDT) Date: Mon, 18 Oct 2021 14:12:32 -0400 From: Kent Overstreet To: Johannes Weiner Cc: Matthew Wilcox , Linus Torvalds , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Morton , "Darrick J. Wong" , Christoph Hellwig , David Howells Subject: Re: Folios for 5.15 request - Was: re: Folio discussion recap - Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: BCA5FE001989 Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=M+cYLFsQ; spf=pass (imf30.hostedemail.com: domain of kent.overstreet@gmail.com designates 209.85.160.178 as permitted sender) smtp.mailfrom=kent.overstreet@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: z4o7o7gmf8doqxty6k915q4woimtfs7y X-Rspamd-Server: rspam05 X-HE-Tag: 1634580754-618688 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000563, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Oct 18, 2021 at 12:47:37PM -0400, Johannes Weiner wrote: > I find this line of argument highly disingenuous. > > No new type is necessary to remove these calls inside MM code. Migrate > them into the callsites and remove the 99.9% very obviously bogus > ones. The process is the same whether you switch to a new type or not. Conversely, I don't see "leave all LRU code as struct page, and ignore anonymous pages" to be a serious counterargument. I got that you really don't want anonymous pages to be folios from the call Friday, but I haven't been getting anything that looks like a serious counterproposal from you. Think about what our goal is: we want to get to a world where our types describe unambigiuously how our data is used. That means working towards - getting rid of type punning - struct fields that are only used for a single purpose Leaving all the LRU code as struct page means leaving a shit ton of type punning in place, and you aren't outlining any alternate ways of dealing with that. As long as all the LRU code is using struct page, that halts efforts towards separately allocating these types and making struct page smaller (which was one of your stated goals as well!), and it would leave a big mess in place for god knows how long. It's been a massive effort for Willy to get this far, who knows when someone else with the requisite skillset would be summoning up the energy to deal with that - I don't see you or I doing it. Meanwhile: we've got people working on using folios for anonymous pages to solve some major problems - it cleans up all of the if (normalpage) else if (hugepage) mess - it'll _majorly_ help with our memory fragmentation problems, as I recently outlined. As long as we've got a very bimodal distribution in our allocation sizes where the peaks are at order 0 and HUGEPAGE_ORDER, we're going to have problems allocating hugepages. If anonymous + file memory can be arbitrary sized compound pages, we'll end up with more of a poisson distribution in our allocation sizes, and a _great deal_ of our difficulties with memory fragmentation are going to be alleviated. - and on architectures that support merging of TLB entries, folios for anonymous memory are going to get us some major performance improvements due to reduced TLB pressure, same as hugepages but without nearly as much memory fragmetation pain And on top of all that, file and anonymous pages are just more alike than they are different. As I keep saying, the sane incremental approach to splitting up struct page into different dedicated types is to follow the union of structs. I get that you REALLY REALLY don't want file and anonymous pages to be the same type, but what you're asking just isn't incremental, it's asking for one big refactoring to be done at the same time as another. > (I'll send more patches like the PageSlab() ones to that effect. It's > easy. The only reason nobody has bothered removing those until now is > that nobody reported regressions when they were added.) I was also pretty frustrated by your response to Willy's struct slab patches. You claim to be all in favour of introducing more type safety and splitting struct page up into multiple types, but on the basis of one objection - that his patches start marking tail slab pages as PageSlab (and I agree with your objection, FWIW) - instead of just asking for that to be changed, or posting a patch that made that change to his series, you said in effect that we shouldn't be doing any of the struct slab stuff by posting your own much more limited refactoring, that was only targeted at the compound_head() issue, which we all agree is a distraction and not the real issue. Why are you letting yourself get distracted by that? I'm not really sure what you want Johannes, besides the fact that you really don't want file and anon pages to be the same type - but I don't see how that gives us a route forwards on the fronts I just outlined.