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=-2.5 required=3.0 tests=MAILING_LIST_MULTI, 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 DDC6FC3A5A3 for ; Thu, 22 Aug 2019 12:52:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B8BC52089E for ; Thu, 22 Aug 2019 12:52:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8BC52089E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3A5086B0311; Thu, 22 Aug 2019 08:52:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 355FB6B0312; Thu, 22 Aug 2019 08:52:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 244E36B0313; Thu, 22 Aug 2019 08:52:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0032.hostedemail.com [216.40.44.32]) by kanga.kvack.org (Postfix) with ESMTP id F11586B0311 for ; Thu, 22 Aug 2019 08:52:34 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 8294D8154 for ; Thu, 22 Aug 2019 12:52:34 +0000 (UTC) X-FDA: 75850052628.07.shoe23_338b59bfae919 X-HE-Tag: shoe23_338b59bfae919 X-Filterd-Recvd-Size: 2385 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Thu, 22 Aug 2019 12:52:34 +0000 (UTC) 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 910B1AE04; Thu, 22 Aug 2019 12:52:32 +0000 (UTC) Date: Thu, 22 Aug 2019 14:52:31 +0200 From: Michal Hocko To: Pankaj Suryawanshi Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vlastimil Babka , pankaj.suryawanshi@einfochips.com Subject: Re: PageBlocks and Migrate Types Message-ID: <20190822125231.GJ12785@dhcp22.suse.cz> References: 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) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000147, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed 21-08-19 22:23:44, Pankaj Suryawanshi wrote: > Hello, > > 1. What are Pageblocks and migrate types(MIGRATE_CMA) in Linux memory ? Pageblocks are a simple grouping of physically contiguous pages with common set of flags. I haven't checked closely recently so I might misremember but my recollection is that only the migrate type is stored there. Normally we would store that information into page flags but there is not enough room there. MIGRATE_CMA represent pages allocated for the CMA allocator. There are other migrate types denoting unmovable/movable allocations or pages that are isolated from the page allocator. Very broadly speaking, the migrate type groups pages with similar movability properties to reduce fragmentation that compaction cannot do anything about because there are objects of different properties around. Please note that pageblock might contain objects of a different migrate type in some cases (e.g. low on memory). Have a look at gfpflags_to_migratetype and how the gfp mask is converted to a migratetype for the allocation. Also follow different MIGRATE_$TYPE to see how it is used in the code. > How many movable/unmovable pages are defined by default? There is nothing like that. It depends on how many objects of a specific type are allocated. HTH -- Michal Hocko SUSE Labs