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 2CBDCC433EF for ; Thu, 12 May 2022 01:11:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ABF7F6B0074; Wed, 11 May 2022 21:11:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A6FFF6B0075; Wed, 11 May 2022 21:11:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 912FD6B0078; Wed, 11 May 2022 21:11:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 7D08D6B0074 for ; Wed, 11 May 2022 21:11:22 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 48AFD31596 for ; Thu, 12 May 2022 01:11:22 +0000 (UTC) X-FDA: 79455312804.30.289E090 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by imf19.hostedemail.com (Postfix) with ESMTP id 68DD01A00A8 for ; Thu, 12 May 2022 01:11:13 +0000 (UTC) Received: by mail-ej1-f50.google.com with SMTP id j6so7183693ejc.13 for ; Wed, 11 May 2022 18:11:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3STZNwG10Vw7zhhIFnH6XuEOiyYPfSnGPUU6iRub2VI=; b=nu8qF2TMpfFNfAYm80vsDlhfeH4/7AFhNdqJ2AudJ+41sUBIaFzpDOr4eUBEZksMI5 W54K2tqUwbBhxOrBUIO5WpgZFv12vTuHem/kaVoZZ/XlRxwciLDz/dEXuKiNVKlvj46D l8qhhlC0Zb7PhEsh/H+jDFzx23Rq5aSLqdj46RaLkNRi/dJxz6RGU1gHvrTr1UP4miKE 3/npC5btgbQKRuKGoUumgdabrKXUBQ+aZkeDyIAcJaojvjuO0yJJ34CDJYFJvv5KevBP I3hiKRYzKSGMVIVau1Zk3jauVqxpN/RDEzKrjFG+fRP9B7LvLo6nzowcolqytb9c7/EW HV/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3STZNwG10Vw7zhhIFnH6XuEOiyYPfSnGPUU6iRub2VI=; b=TdPRsK3bLqgyCZFZnrI67Gq8I59tighdhn9yItqyxM5KLguN9DNMzlDt+ldDYU7eJm bnQQCIDsT5RpnRGyO/pYIRuF2Wpy83KIEwgmExNEl+f7+z7iPNYepFDPF5mxR+3YSUqP nBLfTW2D6/LXEARH8t5ykEOXpkWH+ix94AAXyfRWbseFvcIFBasnkBaf7vNUk5TArIbe Spacil89fI+Xq+djFFuRO8uEYi/1q2UNvYh76HQn9/bWXKeE/X8DO9aHCKPPbbxvh88N gtop4dr5XMzISDTgFAW7UW22693LL4v2A+kCy1lgafpa+eLXyNfNEtTYH/NkHhVHmE4b giOQ== X-Gm-Message-State: AOAM532wXNEQMhwuA3zmVVhDuvR5hnJl6pjwcgRSlMvUIg0ZWmabzhMZ KAaRc9HNTvCwh5dcGj8hgVvKWdADkMjYxyKtOgU= X-Google-Smtp-Source: ABdhPJymyVI7sLCQ3gA1wLhLQRiN00qqEm6/P8bLk+sP7oNtUaCI0JixF5/iNL5LvujLdpgOGNDUx4d4At+GwelEJIU= X-Received: by 2002:a17:906:6bd7:b0:6f4:e6e4:1d41 with SMTP id t23-20020a1709066bd700b006f4e6e41d41mr28063647ejs.770.1652317880448; Wed, 11 May 2022 18:11:20 -0700 (PDT) MIME-Version: 1.0 References: <20220511081207.132034-1-vvghjk1234@gmail.com> <20220511142303.GN20579@suse.de> <20220511154723.GO20579@suse.de> In-Reply-To: <20220511154723.GO20579@suse.de> From: Wonhyuk Yang Date: Thu, 12 May 2022 10:11:10 +0900 Message-ID: Subject: Re: [PATCH] mm/page_alloc: Fix tracepoint mm_page_alloc_zone_locked() To: Mel Gorman 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 Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: fu1uci3au81zwzs5csg7ieqbng6wsqoe X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 68DD01A00A8 X-Rspam-User: Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=nu8qF2TM; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf19.hostedemail.com: domain of vvghjk1234@gmail.com designates 209.85.218.50 as permitted sender) smtp.mailfrom=vvghjk1234@gmail.com X-HE-Tag: 1652317873-551627 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:47 AM Mel Gorman wrote: > > 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. > Okay, I'll send a new one with your suggestions. Thanks