Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1292711img; Tue, 19 Mar 2019 04:46:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1UBmca93VfuvbeftZ4d2WlYb5uYBZ6+s+NDlmqMVJKfCnIdgZctrBIlKD9QNxszfmMqDu X-Received: by 2002:a17:902:5ac9:: with SMTP id g9mr1628876plm.205.1552995971146; Tue, 19 Mar 2019 04:46:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552995971; cv=none; d=google.com; s=arc-20160816; b=qWLVh21IAlbErzQFlQipE/kj16OPk2VWxxE7+Jr1RDao6fonIezWNfJVqHvbUYOKDk LCALTiKgId5Xc7i7ACwP+qCF+szmykcaG14kg3lbZWSsbpe6A4VD0RABLognBvW2jjU6 JsYBjREJHYL1HhGqplfmKojhKyae1e1LtOh3NPcNHE4IDxlCl8rYB/544XeFtowH1UIk vwwyIqmK0xYvrKu+AfrQ9EWprytNwwRR4lAqZ7R7WkC+rv115aPDAo9Nron8SGzVkbsP LBB5CMsOKU2r0X4TWdUiemdubZsLsACcUMUgxBAprmA758G9CuSUdx9EEYxPy9yloeCU HY0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=aJGKjeDfkxq63qK6+Utz9cs+S1CRCPma+t2/scCTmUM=; b=pZLYeBXbqJIlQvQKzvMdG4eD0Z5F6ckssMO4+sXV+vt0H1qkXchPMUh9mfchhtoxJr pjecNw08yuP8djNF2Bd7xTVp8A9vTCl8p9oGKU46nQenLdOfTmST8megttt8l4uoNcS1 zPmGT5qqAgKbJt75pTqYoH0wvndL2hkyN5cOJDSxmmVpG6EVydcqBzbyPyIc2drcNrkk 2Pk6FxCBISamjAlSP9U4o2HTJRtrc/TICu5VTz16zkDuuBjDTXgi3U4ZnkvHyO1ZTRPp b7jbK1NnwZ8Sd+/TM7n9TmMpMgLVpL2a1mr78PoP8f8Sd/stf4ZQ4T099sA05fZSdjY8 Sc+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@eInfochipsIndia.onmicrosoft.com header.s=selector1-einfochips-com header.b=PndsmpbG; 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 w3si10494991pfw.94.2019.03.19.04.45.55; Tue, 19 Mar 2019 04:46:11 -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; dkim=pass header.i=@eInfochipsIndia.onmicrosoft.com header.s=selector1-einfochips-com header.b=PndsmpbG; 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 S1727336AbfCSLpN (ORCPT + 99 others); Tue, 19 Mar 2019 07:45:13 -0400 Received: from mail-eopbgr1310071.outbound.protection.outlook.com ([40.107.131.71]:6276 "EHLO APC01-SG2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726002AbfCSLpM (ORCPT ); Tue, 19 Mar 2019 07:45:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eInfochipsIndia.onmicrosoft.com; s=selector1-einfochips-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aJGKjeDfkxq63qK6+Utz9cs+S1CRCPma+t2/scCTmUM=; b=PndsmpbGeAJGs2qLGVxDS0BCHh+ll/QDZsOEM6RTPEJoab/5OSQ5Wq9DezzziQO/CpHeFAKp9bax/i4gOesyfzIw4rj32v5czpp0i3Tg0gp8iEXgG7LhHf54tLPsTMB4szpAb5eVVXQoY5g6ZsEidLonwcbNqP92+eR2INj/5Ag= Received: from SG2PR02MB3098.apcprd02.prod.outlook.com (20.177.88.78) by SG2PR02MB2700.apcprd02.prod.outlook.com (20.177.85.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.14; Tue, 19 Mar 2019 11:45:03 +0000 Received: from SG2PR02MB3098.apcprd02.prod.outlook.com ([fe80::f432:20e4:2d22:e60b]) by SG2PR02MB3098.apcprd02.prod.outlook.com ([fe80::f432:20e4:2d22:e60b%4]) with mapi id 15.20.1709.015; Tue, 19 Mar 2019 11:45:03 +0000 From: Pankaj Suryawanshi To: Michal Hocko 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 Thread-Topic: [External] Re: mm/cma.c: High latency for cma allocation Thread-Index: AQHU3YpG7XMhet9mv0+1ZFJR3Y1R16YRXCGAgAACGm2AAAebAIAABP0wgAAIBgCAAU6K1oAAEw1b Date: Tue, 19 Mar 2019 11:45:03 +0000 Message-ID: References: <20190318130757.GG8924@dhcp22.suse.cz> <20190318134242.GI8924@dhcp22.suse.cz> ,<20190318142916.GK8924@dhcp22.suse.cz>, In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=pankaj.suryawanshi@einfochips.com; x-originating-ip: [14.98.130.2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f8d42a61-6cb7-449f-521a-08d6ac605393 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020);SRVR:SG2PR02MB2700; x-ms-traffictypediagnostic: SG2PR02MB2700:|SG2PR02MB2700: x-microsoft-antispam-prvs: x-forefront-prvs: 0981815F2F x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(366004)(136003)(346002)(39840400004)(376002)(189003)(199004)(229853002)(66066001)(6436002)(9686003)(52536014)(81166006)(81156014)(8936002)(8676002)(68736007)(5024004)(53936002)(55016002)(478600001)(3846002)(14444005)(14454004)(2940100002)(256004)(86362001)(6116002)(6916009)(99286004)(97736004)(106356001)(5660300002)(486006)(11346002)(7696005)(25786009)(105586002)(446003)(476003)(186003)(102836004)(6246003)(76176011)(6506007)(71190400001)(44832011)(53546011)(55236004)(74316002)(93156006)(305945005)(4326008)(316002)(93886005)(54906003)(33656002)(7736002)(2906002)(26005)(78486014)(66574012)(71200400001)(586874002);DIR:OUT;SFP:1101;SCL:1;SRVR:SG2PR02MB2700;H:SG2PR02MB3098.apcprd02.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: einfochips.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: vTp4PyWNK5Q4wTO/soaConbGoaqij8SazmSblTSnnbfbYJrQ9M/oQBP77JgFkvCse9S1RoXj7ZaCqZSpaUCJYaMcbEHQ+DTZQjhoZxSDMigVv7NGs5EKuXc4VD5yXdTAxml3SvS05OzWuGjt6wSgsbct4ewkIvP2Zh4uKUIwquyPuIYhZ+2tOptY9yYepUSx2WZvzNJC4YctEhSd6pZJBuYEBRe7Tw1507eH++fjoPBne57GS1dGaEEXzqcXIIW+PzHsg4LIZgc/4X/9SHl470Zl5n+DsgjYZ4XLmCDcJ1nI86B8Sn1MLKqDcQqS0gfGIsxF5hgcszXSd+aMc4Xj4xNy8zPDo0bCiYnwnReDdv0U/uDKr+bDIvjAvJr3ywD2KRqTwLj4h0p+BUx5lIiXj1OO4R1qldwnQi5jrz+GUe4= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: einfochips.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8d42a61-6cb7-449f-521a-08d6ac605393 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2019 11:45:03.6814 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0adb040b-ca22-4ca6-9447-ab7b049a22ff X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR02MB2700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ________________________________________ From: Pankaj Suryawanshi Sent: 19 March 2019 15:59 To: Michal Hocko Cc: linux-mm@kvack.org; linux-kernel@vger.kernel.org; minchan@kernel.org; K= irill Tkhai Subject: Re: [External] Re: mm/cma.c: High latency for cma allocation ________________________________________ From: Michal Hocko Sent: 18 March 2019 19:59 To: Pankaj Suryawanshi Cc: linux-mm@kvack.org; linux-kernel@vger.kernel.org; minchan@kernel.org; K= irill Tkhai Subject: Re: [External] Re: mm/cma.c: High latency for cma allocation On Mon 18-03-19 14:02:09, Pankaj Suryawanshi wrote: >> > I have the system(vanilla kernel) with 2GB of RAM, reserved 1GB for CM= A. No swap or zram. >> > Sorry, I don't have information where the time is spent. >> > time is calculated in between cma_alloc call. >> > I have just cma_alloc trace information/function graph. > >> Then please collect that data because it is really hard to judge >> anything from the numbers you have provided. > > Any pointers from which i can get this details ? I would start by enabling built in tracepoints for the migration or use a system wide perf monitoring with call graph data. Calling Sequence is as below. cma_alloc() --> alloc_contig_range() --> start_isolate_page_range() --> __alloc_contig_migrate_range() --> isolate_migratepages_range() --> reclaim_clean_pages_from_list() --> shrink_page_list() There is no built in tracepoints except cma_alloc. How to know where it taking time ? 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=3D 43 migrate=3D128 migrateranges=3D23 [ 1151.421209] LATENCY reclaim=3D 11 migrate=3D253 migrateranges=3D14 [ 1151.427856] LATENCY reclaim=3D 45 migrate=3D12 migrateranges=3D12 [ 1151.434485] LATENCY reclaim=3D 44 migrate=3D33 migrateranges=3D12 [ 1151.440975] LATENCY reclaim=3D 45 migrate=3D0 migrateranges=3D11 [ 1151.447513] LATENCY reclaim=3D 39 migrate=3D35 migrateranges=3D11 [ 1151.453919] LATENCY reclaim=3D 46 migrate=3D0 migrateranges=3D12 [ 1151.460474] LATENCY reclaim=3D 39 migrate=3D41 migrateranges=3D11 [ 1151.466947] LATENCY reclaim=3D 54 migrate=3D32 migrateranges=3D17 [ 1151.473464] LATENCY reclaim=3D 45 migrate=3D21 migrateranges=3D12 [ 1151.480016] LATENCY reclaim=3D 41 migrate=3D39 migrateranges=3D12 [ 1151.486551] LATENCY reclaim=3D 41 migrate=3D36 migrateranges=3D12 [ 1151.493199] LATENCY reclaim=3D 13 migrate=3D188 migrateranges=3D12 [ 1151.500034] LATENCY reclaim=3D 60 migrate=3D94 migrateranges=3D13 [ 1151.506686] LATENCY reclaim=3D 78 migrate=3D9 migrateranges=3D12 [ 1151.513313] LATENCY reclaim=3D 33 migrate=3D147 migrateranges=3D12 [ 1151.519839] LATENCY reclaim=3D 52 migrate=3D98 migrateranges=3D12 [ 1151.526556] LATENCY reclaim=3D 46 migrate=3D126 migrateranges=3D12 [ 1151.533254] LATENCY reclaim=3D 22 migrate=3D230 migrateranges=3D12 [ 1151.540145] LATENCY reclaim=3D 0 migrate=3D305 migrateranges=3D13 [ 1151.546997] LATENCY reclaim=3D 1 migrate=3D301 migrateranges=3D13 [ 1151.553686] LATENCY reclaim=3D 40 migrate=3D201 migrateranges=3D12 [ 1151.560395] LATENCY reclaim=3D 35 migrate=3D149 migrateranges=3D12 [ 1151.567076] LATENCY reclaim=3D 77 migrate=3D43 migrateranges=3D16 [ 1151.573836] LATENCY reclaim=3D 34 migrate=3D190 migrateranges=3D12 [ 1151.580510] LATENCY reclaim=3D 51 migrate=3D120 migrateranges=3D12 [ 1151.587240] LATENCY reclaim=3D 33 migrate=3D147 migrateranges=3D13 [ 1151.594036] LATENCY reclaim=3D 20 migrate=3D241 migrateranges=3D13 [ 1151.600749] LATENCY reclaim=3D 75 migrate=3D41 migrateranges=3D13 [ 1151.607402] LATENCY reclaim=3D 77 migrate=3D32 migrateranges=3D12 [ 1151.613956] LATENCY reclaim=3D 72 migrate=3D35 migrateranges=3D12 [ 1151.620642] LATENCY reclaim=3D 59 migrate=3D162 migrateranges=3D12 [ 1151.627181] LATENCY reclaim=3D 76 migrate=3D9 migrateranges=3D11 [ 1151.633795] LATENCY reclaim=3D 80 migrate=3D0 migrateranges=3D12 [ 1151.640278] LATENCY reclaim=3D 87 migrate=3D18 migrateranges=3D12 [ 1151.646758] LATENCY reclaim=3D 82 migrate=3D10 migrateranges=3D11 [ 1151.653307] LATENCY reclaim=3D 71 migrate=3D31 migrateranges=3D12 [ 1151.659911] LATENCY reclaim=3D 61 migrate=3D77 migrateranges=3D12 [ 1151.666514] LATENCY reclaim=3D 94 migrate=3D42 migrateranges=3D15 [ 1151.673089] LATENCY reclaim=3D 67 migrate=3D59 migrateranges=3D12 [ 1151.679655] LATENCY reclaim=3D 81 migrate=3D14 migrateranges=3D12 [ 1151.686253] LATENCY reclaim=3D 49 migrate=3D93 migrateranges=3D12 [ 1151.692815] LATENCY reclaim=3D 61 migrate=3D54 migrateranges=3D12 [ 1151.699438] LATENCY reclaim=3D 42 migrate=3D99 migrateranges=3D10 [ 1151.705881] OVERALL overall=3D285157 cma_alloc latency is =3D 297385 us Please let me know is there any workaround/solution to reduce large size bu= ffer cma_alloc latency ? -- Michal Hocko SUSE Labs ***************************************************************************= ***************************************************************************= ******* eInfochips Business Disclaimer: This e-mail message and all attachm= ents transmitted with it are intended solely for the use of the addressee a= nd may contain legally privileged and confidential information. If the read= er of this message is not the intended recipient, or an employee or agent r= esponsible for delivering this message to the intended recipient, you are h= ereby notified that any dissemination, distribution, copying, or other use = of this message or its attachments is strictly prohibited. If you have rece= ived this message in error, please notify the sender immediately by replyin= g to this message and please delete it from your computer. Any views expres= sed in this message are those of the individual sender unless otherwise sta= ted. Company has taken enough precautions to prevent the spread of viruses.= However the company accepts no liability for any damage caused by any viru= s transmitted by this email. **********************************************= ***************************************************************************= ************************************