Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp502469img; Thu, 21 Mar 2019 02:55:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzy2hpDeOIihrgygftbPick/4pi8HAbGqkHceW6XkxyF/zRylYJMTfP4XCRxvwtIWQa/P5X X-Received: by 2002:a62:12c8:: with SMTP id 69mr2475409pfs.184.1553162101430; Thu, 21 Mar 2019 02:55:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553162101; cv=none; d=google.com; s=arc-20160816; b=VOJvHFQa0b6xwvjTj2VKwhg86h1NcZUCM4pIbyXx0WhJhLBsRTgqgt/8kL+uvkfDXd rhBmgIURpnKZ1s5ZXhQvvqERQm9KhXAU/8xQI0hQgLgvZvabl2bTmXMMZYkFG1xqei3G X8whdpy9aNiz0Dkpj7kMx1LSzCNeBENJr6PFc9j8+I7uO9J/MP+ZO0F2191ayMaqgdTF bq1WiyS2RDJZd01Di+pqR4wbqarjcvsRA4cXM+PSQkzhTjZKn99uUAjmvEiRPjdxrumD Up4WF4s5EKFDVLE4WSJYpodd4b//+qjBHUjpzbJi4tgAfuAzk//hsZufv5VSRZSk9EXq OkaA== 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=R2fHyczZrMyxTT/SnziV5HJuFeU5Zf81UxAwYCwe/xU=; b=MRZczpX81Nkb4NEREPZAgAksJrBQE7w3+BTvDdO2l7AIYemztNycMedqCDeKy5zDD0 AmUlBjM+cHLoZx3uYAwOEjjBvYdETXIvr/SPM02RPPhne/HgeY5waC+G3WRIHQsSQT5Q plpNLpfGRygcwoR4q4mVtE8hibn4njQ7dmRVC0GkTrcJMHZQfDMYacSc74V+PT7dWjJd +WME6zpTQ9cbxhVXSIHBEzArjvU3pPH5AiNnJldnFJD+gElE+6onKFXQH2HLL1DoTSs9 Cw3DcgOjSUT8h5OPdpB99+cqWGxiSeNOUcEg19UsVLs5i6zcFyse8EQkel7l4VVXkXM/ sojw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 59si4185449plc.84.2019.03.21.02.54.43; Thu, 21 Mar 2019 02:55:01 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728257AbfCUJxl (ORCPT + 99 others); Thu, 21 Mar 2019 05:53:41 -0400 Received: from mx2.suse.de ([195.135.220.15]:52496 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728049AbfCUJxk (ORCPT ); Thu, 21 Mar 2019 05:53:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 67D92B0BE; Thu, 21 Mar 2019 09:53:38 +0000 (UTC) Date: Thu, 21 Mar 2019 10:53:37 +0100 From: Michal Hocko To: Pankaj Suryawanshi Cc: "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "minchan@kernel.org" , Kirill Tkhai Subject: Re: [External] Re: mm/cma.c: High latency for cma allocation Message-ID: <20190321095337.GM8696@dhcp22.suse.cz> References: <20190318130757.GG8924@dhcp22.suse.cz> <20190318134242.GI8924@dhcp22.suse.cz> <20190318142916.GK8924@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Can you please fix your email client? The broken quoting is just irritating. On Tue 19-03-19 11:45:03, Pankaj Suryawanshi wrote: [...] > I have tried for latency count for 385MB: > > reclaim- reclaim_clean_pages_from_list() > migrate- migrate_pages() > migrateranges- isolate_migratepages_range() > overall - __alloc_contig_migrate_range() > > Note: output is in us > > [ 1151.420923] LATENCY reclaim= 43 migrate=128 migrateranges=23 > [ 1151.421209] LATENCY reclaim= 11 migrate=253 migrateranges=14 > [ 1151.427856] LATENCY reclaim= 45 migrate=12 migrateranges=12 > [ 1151.434485] LATENCY reclaim= 44 migrate=33 migrateranges=12 > [ 1151.440975] LATENCY reclaim= 45 migrate=0 migrateranges=11 > [ 1151.447513] LATENCY reclaim= 39 migrate=35 migrateranges=11 > [ 1151.453919] LATENCY reclaim= 46 migrate=0 migrateranges=12 > [ 1151.460474] LATENCY reclaim= 39 migrate=41 migrateranges=11 > [ 1151.466947] LATENCY reclaim= 54 migrate=32 migrateranges=17 > [ 1151.473464] LATENCY reclaim= 45 migrate=21 migrateranges=12 > [ 1151.480016] LATENCY reclaim= 41 migrate=39 migrateranges=12 > [ 1151.486551] LATENCY reclaim= 41 migrate=36 migrateranges=12 > [ 1151.493199] LATENCY reclaim= 13 migrate=188 migrateranges=12 > [ 1151.500034] LATENCY reclaim= 60 migrate=94 migrateranges=13 > [ 1151.506686] LATENCY reclaim= 78 migrate=9 migrateranges=12 > [ 1151.513313] LATENCY reclaim= 33 migrate=147 migrateranges=12 > [ 1151.519839] LATENCY reclaim= 52 migrate=98 migrateranges=12 > [ 1151.526556] LATENCY reclaim= 46 migrate=126 migrateranges=12 > [ 1151.533254] LATENCY reclaim= 22 migrate=230 migrateranges=12 > [ 1151.540145] LATENCY reclaim= 0 migrate=305 migrateranges=13 > [ 1151.546997] LATENCY reclaim= 1 migrate=301 migrateranges=13 > [ 1151.553686] LATENCY reclaim= 40 migrate=201 migrateranges=12 > [ 1151.560395] LATENCY reclaim= 35 migrate=149 migrateranges=12 > [ 1151.567076] LATENCY reclaim= 77 migrate=43 migrateranges=16 > [ 1151.573836] LATENCY reclaim= 34 migrate=190 migrateranges=12 > [ 1151.580510] LATENCY reclaim= 51 migrate=120 migrateranges=12 > [ 1151.587240] LATENCY reclaim= 33 migrate=147 migrateranges=13 > [ 1151.594036] LATENCY reclaim= 20 migrate=241 migrateranges=13 > [ 1151.600749] LATENCY reclaim= 75 migrate=41 migrateranges=13 > [ 1151.607402] LATENCY reclaim= 77 migrate=32 migrateranges=12 > [ 1151.613956] LATENCY reclaim= 72 migrate=35 migrateranges=12 > [ 1151.620642] LATENCY reclaim= 59 migrate=162 migrateranges=12 > [ 1151.627181] LATENCY reclaim= 76 migrate=9 migrateranges=11 > [ 1151.633795] LATENCY reclaim= 80 migrate=0 migrateranges=12 > [ 1151.640278] LATENCY reclaim= 87 migrate=18 migrateranges=12 > [ 1151.646758] LATENCY reclaim= 82 migrate=10 migrateranges=11 > [ 1151.653307] LATENCY reclaim= 71 migrate=31 migrateranges=12 > [ 1151.659911] LATENCY reclaim= 61 migrate=77 migrateranges=12 > [ 1151.666514] LATENCY reclaim= 94 migrate=42 migrateranges=15 > [ 1151.673089] LATENCY reclaim= 67 migrate=59 migrateranges=12 > [ 1151.679655] LATENCY reclaim= 81 migrate=14 migrateranges=12 > [ 1151.686253] LATENCY reclaim= 49 migrate=93 migrateranges=12 > [ 1151.692815] LATENCY reclaim= 61 migrate=54 migrateranges=12 > [ 1151.699438] LATENCY reclaim= 42 migrate=99 migrateranges=10 > [ 1151.705881] OVERALL overall=285157 cumulative numbers are reclaim:2222 migrate:3995 migrateranges:552 sum:6217 So those code paths you were measuring were contributing to the overal latency only marginally (~2%). > cma_alloc latency is = 297385 us As I've said earlier I would just use perf with the call graph support and look at the time distribution to see where the bottleneck is. -- Michal Hocko SUSE Labs