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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3532C433EF for ; Wed, 11 May 2022 15:47:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 268F06B0075; Wed, 11 May 2022 11:47:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 218C76B0078; Wed, 11 May 2022 11:47:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 094EB6B007B; Wed, 11 May 2022 11:47:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id EE4A56B0075 for ; Wed, 11 May 2022 11:47:29 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id ABB6631EC6 for ; Wed, 11 May 2022 15:47:29 +0000 (UTC) X-FDA: 79453891818.17.8F82CE8 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf02.hostedemail.com (Postfix) with ESMTP id 9F1CE800B8 for ; Wed, 11 May 2022 15:47:21 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 8A7F121CCD; Wed, 11 May 2022 15:47:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1652284047; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WsIKEP1mbw5K0lCm4lLy/bWkBCAiurzAzt71iQfxPDQ=; b=Iev1ORle/s9/sJqgo3MPar0Rupc/yOav3+l71U9IZYe9pPoAPTXz+WkmSSQjtnGLJSyPGF vbo4CDVr5EoZ9QnWNSf+9g+FYW/lOCj613IF1v0eQ/41q5Uu24bhAYb382for5Rt1iV8Ny pVu+ILxkjJT9WdSoSF7hSCsfK9lvOR4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1652284047; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WsIKEP1mbw5K0lCm4lLy/bWkBCAiurzAzt71iQfxPDQ=; b=z6CdKNXF5ot/9K/p4qUZP68t5TtSsIgYRzwERBHklbJTzbXaS7wr4ZQsGzOS0L5pj5VTlE xO9oXNFyUt5fT3CA== Received: from suse.de (unknown [10.163.32.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id AE0DE2C141; Wed, 11 May 2022 15:47:25 +0000 (UTC) Date: Wed, 11 May 2022 16:47:23 +0100 From: Mel Gorman To: Wonhyuk Yang Cc: Steven Rostedt , Ingo Molnar , Andrew Morton , Baik Song An , Hong Yeon Kim , Taeung Song , linuxgeek@linuxgeek.io, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] mm/page_alloc: Fix tracepoint mm_page_alloc_zone_locked() Message-ID: <20220511154723.GO20579@suse.de> References: <20220511081207.132034-1-vvghjk1234@gmail.com> <20220511142303.GN20579@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 9F1CE800B8 X-Stat-Signature: 5wa13gos459dztce3p1871sjxg3mcu4x Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Iev1ORle; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=z6CdKNXF; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf02.hostedemail.com: domain of mgorman@suse.de designates 195.135.220.28 as permitted sender) smtp.mailfrom=mgorman@suse.de X-Rspam-User: X-HE-Tag: 1652284041-562596 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 Thu, May 12, 2022 at 12:02:30AM +0900, Wonhyuk Yang wrote: > > The original intent of that tracepoint was to trace when pages were > > removed from the buddy list. That would suggest this untested patch on > > top of yours as a simplication; > > > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > > index 0351808322ba..66a70b898130 100644 > > --- a/mm/page_alloc.c > > +++ b/mm/page_alloc.c > > @@ -2476,6 +2476,8 @@ struct page *__rmqueue_smallest(struct zone *zone, unsigned int order, > > del_page_from_free_list(page, zone, current_order); > > expand(zone, page, order, current_order, migratetype); > > set_pcppage_migratetype(page, migratetype); > > + trace_mm_page_alloc_zone_locked(page, order, migratetype, > > + pcp_allowed_order(order) && migratetype < MIGRATE_PCPTYPES); > > return page; > > } > > Interestingly, my first approach was quite similar your suggestion. But I > noticed that there can be a request whose migration type is MOVABLE > and alloc_flags doen't have ALLOC_CMA. In that case, page are marked > as percpu-refill even though it was allocated from buddy-list directly. > Is there no problem if we just ignore this case? > I assume you are referring to the case where CMA allocations are being balanced between regular and CMA areas. I think it's relatively harmless if percpu_refill field is not 100% accurate for that case. There are also cases like the percpu list is too small to hold a THP and it's not a percpu_refill either. If 100% accuracy is an issue, I would prefer renaming it to percpu_eligible or just deleting it instead of adding complexity for a tracepoint. The main value of that tracepoint is determining what percentage of allocations are potentially contending on zone lock at a particular time. -- Mel Gorman SUSE Labs