Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1789221imm; Thu, 18 Oct 2018 04:22:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV60GfncoPMX9QWUwkqFZo2OfGR1mjFgzMBRFWlBkL98Sv7JuH+1iPP7UtF9HJuUMKjPEGvpK X-Received: by 2002:a62:75c7:: with SMTP id q190-v6mr30487843pfc.137.1539861774933; Thu, 18 Oct 2018 04:22:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539861774; cv=none; d=google.com; s=arc-20160816; b=z20Zn8XiEKcfqHpJ5fQjtSO4yU6GtEXQYuGik/L3YjTT+xOMKVAbPVejCb9EogHDoj nElch+EdzylukuqFOHrWahcqPutvwDEXK5d+Fb/0ePS8R5cuU5iBal+qiZDc1LDySt/S tDXifLa8Lsw0pJAiYICj/ElntlJ6jRxXyBmvTLikHaGc4y36Du6gBw57rxe4BOoilY+y jKv+HsIX70ZsQ850k7GzcC8i3vZ9eiJDk5eiPav3w2YnAwVwC+pXiCnVmG0I6J8NZhg0 jX2aQvDSiKnCgc9LTWs808Rok+bW96ZbgeRJduazcALEc4V8G4VvLK6VnhLLA8z8xQNi TwqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=I6GfGRVgj9E0XGs8pfyoKaYxWzBuH3POteGBpWQxT+M=; b=vpoxnmhmnJUGN0JFH5qytQMuGqYzkRQ9I8lh3+7unpxKTNzv40ODL+fDIOD+G02VDF zY6il5k9nkiGZbCTTKx06XaxmJT79c8TyTuW60cCbpNI1X/DdZfCj2mGIcPl4YnQ1bvd zZrbgwHIT906ZnM5LDfWF0pRlDF8ht47CoBpMU9tOfWvKKfVBYS4q7mVx0D8m4g9zqOY sdRDXaGV/OGCObjwYOolBVcFtkFRP5iQFyN82PNj3LnfRh+xMCCYXLiKTBy3kOOc9NhO uIJ4wDEv4/1we9lcI8HdR0YfpgH7BYDIfujLEAEhdS3FvYM7p+cc8nVq2CJ0WbzqCrWp dtpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e36-v6si20959047pge.127.2018.10.18.04.22.39; Thu, 18 Oct 2018 04:22:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728093AbeJRTVc (ORCPT + 99 others); Thu, 18 Oct 2018 15:21:32 -0400 Received: from outbound-smtp11.blacknight.com ([46.22.139.106]:42170 "EHLO outbound-smtp11.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727461AbeJRTVc (ORCPT ); Thu, 18 Oct 2018 15:21:32 -0400 Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp11.blacknight.com (Postfix) with ESMTPS id 8B2261C2041 for ; Thu, 18 Oct 2018 12:20:57 +0100 (IST) Received: (qmail 19169 invoked from network); 18 Oct 2018 11:20:57 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[37.228.229.142]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 18 Oct 2018 11:20:57 -0000 Date: Thu, 18 Oct 2018 12:20:55 +0100 From: Mel Gorman To: Aaron Lu Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Huang Ying , Dave Hansen , Kemi Wang , Tim Chen , Andi Kleen , Michal Hocko , Vlastimil Babka , Matthew Wilcox , Daniel Jordan , Tariq Toukan , Jesper Dangaard Brouer Subject: Re: [RFC v4 PATCH 3/5] mm/rmqueue_bulk: alloc without touching individual page structure Message-ID: <20181018112055.GN5819@techsingularity.net> References: <20181017063330.15384-1-aaron.lu@intel.com> <20181017063330.15384-4-aaron.lu@intel.com> <20181017112042.GK5819@techsingularity.net> <20181017142327.GB9167@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20181017142327.GB9167@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 17, 2018 at 10:23:27PM +0800, Aaron Lu wrote: > > RT has had problems with cpu_relax in the past but more importantly, as > > this delay for parallel compactions and allocations of contig ranges, > > we could be stuck here for very long periods of time with interrupts > > The longest possible time is one CPU accessing pcp->batch number cold > cachelines. Reason: > When zone_wait_cluster_alloc() is called, we already held zone lock so > no more allocations are possible. Waiting in_progress to become zero > means waiting any CPU that increased in_progress to finish processing > their allocated pages. Since they will at most allocate pcp->batch pages > and worse case are all these page structres are cache cold, so the > longest wait time is one CPU accessing pcp->batch number cold cache lines. > > I have no idea if this time is too long though. > But compact_zone calls zone_wait_and_disable_cluster_alloc so how is the disabled time there bound by pcp->batch? > > disabled. It gets even worse if it's from an interrupt context such as > > jumbo frame allocation or a high-order slab allocation that is atomic. > > My understanding is atomic allocation won't trigger compaction, no? > No, they can't. I didn't check properly but be wary of any possibility whereby interrupts can get delayed in zone_wait_cluster_alloc. I didn't go back and check if it can -- partially because I'm more focused on the lazy buddy aspect at the moment. > > It may be necessary to consider instead minimising the number > > of struct page update when merging to PCP and then either increasing the > > size of the PCP or allowing it to exceed pcp->high for short periods of > > time to batch the struct page updates. > > I don't quite follow this part. It doesn't seem possible we can exceed > pcp->high in allocation path, or are you talking about free path? > I'm talking about the free path. > And thanks a lot for the review! My pleasure, hope it helps. -- Mel Gorman SUSE Labs