Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp312953rwd; Fri, 26 May 2023 20:39:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6cVqDYu3zV+9esbMH0710QBlPBKuouQJ3U4s07F8TnLEry/A/uN6udDsiXGewCxNFbRKaj X-Received: by 2002:a17:903:191:b0:1af:f8a8:5ba4 with SMTP id z17-20020a170903019100b001aff8a85ba4mr5454731plg.4.1685158758485; Fri, 26 May 2023 20:39:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685158758; cv=none; d=google.com; s=arc-20160816; b=ToNuYFq6TJd4lKPMRc8fs5z63rKTdpHy0wZ3wWP3Jlg3icOJXNjs2vAoS8ODKchinY lnazE2YWJ0yBWQ0TqCe4xf2iKAMOcJxlXbo6UruZxuhHJiLMi2gaAfijKfHJwAj2+95I Ret7DXozcYB0oglBO1885JiCuw8ULz708gvoja/PYxjaFRJzQzcvgvD00M5kZu00y6tk c9m1ZFrHEBKTSQyvOinHjExrOJVXxMWri2kFBiAdpfTq2RHk6rjueKLPiHJBmocT3nDz q1gqEx7+onB53TXdvZ90Ux8Ec847kCuY3H21uUx08LQg05KeCiO2vujRMQLCJpINvM+L 4AEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hirSS0lNlrtCE60q+oZ9YkZaBfSH5GDFvjqZfjQXkZc=; b=FDqhyauN2jQkQs/phJbcY465St7q2P/51yV8DbKgjXyc/EOmYYFlOfbFmo+WoPB0+S jrZnUz9IWqFdzwHRXh1yAiAzataPayShLMYK2BaptzZEl5e2p9nHVpUyGp+cWUMi9V5i yjE011eMreC8qSe6Vj07qRaSNQj04Zw60QEPUv3Lqk2lpkYJzpO8Fy1iqJnx5n9PdpTU fuF4KI0duTboW6sQaWIaluseTyWM0z4JcMk6iPZWsJP5NroAGL/ooU+GjyLhXAOc9FDa ZrzsljoJDHcMwBng+46dRP9sKfvij9oKo1rDARoY8JZV4DY+Xdz4DuN1itOzwPbWCEPs FgAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Rb7ZgsJY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b20-20020a170902d89400b001a8096ef2bfsi5312078plz.34.2023.05.26.20.39.03; Fri, 26 May 2023 20:39:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Rb7ZgsJY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235873AbjE0DSf (ORCPT + 99 others); Fri, 26 May 2023 23:18:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbjE0DSd (ORCPT ); Fri, 26 May 2023 23:18:33 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1057B99 for ; Fri, 26 May 2023 20:18:31 -0700 (PDT) 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=hirSS0lNlrtCE60q+oZ9YkZaBfSH5GDFvjqZfjQXkZc=; b=Rb7ZgsJYO4YhTxAlvvlGehrro+ +JFMNAO1Zax7qSZTOS/BYLujt/b8zOzWAY45Uo6Df5cWgU9uxaCP0tEtfK0UvyYEnC4E6TCgtMr3o 9I99EQqiaVYROKPMiZq06hBJZHb2FQYof7FgdiyS6LMU9kzLxzjHh+PyTsJpEF5mU+lEJVanhaFAQ B34hWYASoYl28bJmL5dHEO/PhjBvMda92T6DA23T59v63v8AP8jzQEzdzit0mQdnFbsF9EMDZ+C73 iVXIb2cuE+dlQdfFL/SVRDB/mI+wgjw4lC2sauksxu8awaBM6q85px3ixYnoh+btzgUQRs0VBLsLO 6pWyIXwg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1q2kRT-003TLK-ER; Sat, 27 May 2023 03:18:07 +0000 Date: Sat, 27 May 2023 04:18:07 +0100 From: Matthew Wilcox To: John Hubbard Cc: David Hildenbrand , Khalid Aziz , Steven Sistare , akpm@linux-foundation.org, ying.huang@intel.com, mgorman@techsingularity.net, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Khalid Aziz Subject: Re: [PATCH v4] mm, compaction: Skip all non-migratable pages during scan Message-ID: References: <60367660-f4a3-06dc-4d17-4dbdc733ef74@oracle.com> <846b770c-9f63-90a2-0435-ec82484e3f74@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <846b770c-9f63-90a2-0435-ec82484e3f74@nvidia.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 26, 2023 at 07:11:05PM -0700, John Hubbard wrote: > > So any user with 1024 processes can fragment physical memory? :/ > > > > Sorry, I'd like to minimize the usage of folio_maybe_dma_pinned(). > > I was actually thinking that we should minimize any more cases of > fragile mapcount and refcount comparison, which then leads to > Matthew's approach here! I was wondering if we shouldn't make folio_maybe_dma_pinned() a little more accurate. eg: if (folio_test_large(folio)) return atomic_read(&folio->_pincount) > 0; return (unsigned)(folio_ref_count(folio) - folio_mapcount(folio)) >= GUP_PIN_COUNTING_BIAS;