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=-7.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 198D1C4708C for ; Fri, 28 May 2021 09:53:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8364B6113E for ; Fri, 28 May 2021 09:52:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8364B6113E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 16B1D6B006C; Fri, 28 May 2021 05:52:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 11C116B006E; Fri, 28 May 2021 05:52:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EAF986B0070; Fri, 28 May 2021 05:52:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0233.hostedemail.com [216.40.44.233]) by kanga.kvack.org (Postfix) with ESMTP id B2DEE6B006C for ; Fri, 28 May 2021 05:52:58 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4CA931814C3B0 for ; Fri, 28 May 2021 09:52:58 +0000 (UTC) X-FDA: 78190176036.20.03DA59A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf07.hostedemail.com (Postfix) with ESMTP id CA8C3A001AAF for ; Fri, 28 May 2021 09:52:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622195577; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nsLO7oE7ppzKwDyWlT5ZZ5W2YnsqsWgEvpJ/TDeViTw=; b=aC6mxXWL1XGAnAUymOxeM3mZLmhCVdQym+yM2BtEVeg+rf5X3MYb2Dg1zFveLtLUeEZJC3 Mu21pokCum9w6eRaE37Af/uGu6jtWOHvSMM8KeKH52vAijKxxvxbXdmlg/RYG1UOPi4ezg 99ilS4cyu+trsNtjYyD8rye5hY3Mv+M= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-421-0ZGgzj42PjeC5RDlVuZ8Qw-1; Fri, 28 May 2021 05:52:55 -0400 X-MC-Unique: 0ZGgzj42PjeC5RDlVuZ8Qw-1 Received: by mail-wm1-f69.google.com with SMTP id h129-20020a1c21870000b02901743c9f70b9so953509wmh.6 for ; Fri, 28 May 2021 02:52:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=nsLO7oE7ppzKwDyWlT5ZZ5W2YnsqsWgEvpJ/TDeViTw=; b=n+dZ+ncNYr92D0cJyE8x4IfmcSgMwI5IUVNr/fNMZ4otQXVGsgtMgyxSb+6/3foo85 9gRr6ckbYWLCt6jOcn0sIAIo4Q7JtFwROO6hVBKFR3CObfo+2HGgUyvPXInWcipt7tXh QLjFqU5gev5pm1u/owUVgRDqQD8bo71uoZgpXf5kK6epFaNIVBo1+4/+cCZp6koA5fVY zn2GgsWC8gloxEpq7du4Ow11DY7vSTRw+ISjHl5SrdKhSpc+t6FsWQwqYAfr/vkegMwm LISlEIfM/ehlXuKhMlYAdT3U7yTy3j4Cnni4tyrTMtacwd2tGADwB5cQw5Kb6Go8eHrL 0Fpw== X-Gm-Message-State: AOAM530+AgBhDwgwqHS3DNjwV+i5drT05WMrmZdNQilPTYca78LErdcn hsD1N52/Lt9JJ3qvl8ymlgwDRc1JpN/rz96x8oAeUQArXpZdR5+xamxzMYBstNfTcTS6H7Nid4X hmlp/tgxvRNk= X-Received: by 2002:a5d:678d:: with SMTP id v13mr7837050wru.83.1622195574451; Fri, 28 May 2021 02:52:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxG4YyUeXor4MT0iGqBaZAOV/7On75O7U8GctRL57wC7nBOjUUfEzxiFJ/HR6a3s5j8EhW+Lg== X-Received: by 2002:a5d:678d:: with SMTP id v13mr7837021wru.83.1622195574175; Fri, 28 May 2021 02:52:54 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6870.dip0.t-ipconnect.de. [91.12.104.112]) by smtp.gmail.com with ESMTPSA id y22sm15948776wma.36.2021.05.28.02.52.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 May 2021 02:52:53 -0700 (PDT) Subject: Re: [PATCH 0/6 v2] Calculate pcp->high based on zone sizes and active CPUs To: Mel Gorman Cc: Dave Hansen , Andrew Morton , Hillf Danton , Dave Hansen , Vlastimil Babka , Michal Hocko , LKML , Linux-MM , "Tang, Feng" References: <20210525080119.5455-1-mgorman@techsingularity.net> <7177f59b-dc05-daff-7dc6-5815b539a790@intel.com> <20210528085545.GJ30378@techsingularity.net> <54ff0363-2f39-71d1-e26c-962c3fddedae@redhat.com> <20210528094949.GL30378@techsingularity.net> From: David Hildenbrand Organization: Red Hat Message-ID: <6c189def-11cc-80db-0fde-56aa506cfdea@redhat.com> Date: Fri, 28 May 2021 11:52:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210528094949.GL30378@techsingularity.net> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=aC6mxXWL; spf=none (imf07.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: CA8C3A001AAF X-Stat-Signature: 9qrc5qh7e9igxt8e13efexkmsij6bgaq X-HE-Tag: 1622195568-87985 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 28.05.21 11:49, Mel Gorman wrote: > On Fri, May 28, 2021 at 11:08:01AM +0200, David Hildenbrand wrote: >> On 28.05.21 11:03, David Hildenbrand wrote: >>> On 28.05.21 10:55, Mel Gorman wrote: >>>> On Thu, May 27, 2021 at 12:36:21PM -0700, Dave Hansen wrote: >>>>> Hi Mel, >>>>> >>>>> Feng Tang tossed these on a "Cascade Lake" system with 96 threads and >>>>> ~512G of persistent memory and 128G of DRAM. The PMEM is in "volatile >>>>> use" mode and being managed via the buddy just like the normal RAM. >>>>> >>>>> The PMEM zones are big ones: >>>>> >>>>> present 65011712 = 248 G >>>>> high 134595 = 525 M >>>>> >>>>> The PMEM nodes, of course, don't have any CPUs in them. >>>>> >>>>> With your series, the pcp->high value per-cpu is 69584 pages or about >>>>> 270MB per CPU. Scaled up by the 96 CPU threads, that's ~26GB of >>>>> worst-case memory in the pcps per zone, or roughly 10% of the size of >>>>> the zone. >>> >>> When I read about having such big amounts of free memory theoretically >>> stuck in PCP lists, I guess we really want to start draining the PCP in >>> alloc_contig_range(), just as we do with memory hotunplug when offlining. >>> >> >> Correction: we already drain the pcp, we just don't temporarily disable it, >> so a race as described in offline_pages() could apply: >> >> "Disable pcplists so that page isolation cannot race with freeing >> in a way that pages from isolated pageblock are left on pcplists." >> >> Guess we'd then want to move the draining before start_isolate_page_range() >> in alloc_contig_range(). >> > > Or instead of draining, validate the PFN range in alloc_contig_range > is within the same zone and if so, call zone_pcp_disable() before > start_isolate_page_range and enable after __alloc_contig_migrate_range. > We require the caller to only pass a range within a single zone, so that should be fine. The only ugly thing about zone_pcp_disable() is mutex_lock(&pcp_batch_high_lock) which would serialize all alloc_contig_range() and even with offline_pages(). -- Thanks, David / dhildenb