Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1037458iob; Fri, 13 May 2022 20:35:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzni3kfuTAtsUv/ojiBYrarM3VbVO5wEbodWCMuLJRwpefTLSci810WM2AKMuar8ZqKxex X-Received: by 2002:a5d:5085:0:b0:20a:e090:85ad with SMTP id a5-20020a5d5085000000b0020ae09085admr6160963wrt.235.1652499321004; Fri, 13 May 2022 20:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652499321; cv=none; d=google.com; s=arc-20160816; b=YyDQRuPjLOrTqOA28Fwfc9DSrABrVSWE9/UWhmbEPTvfUJ9HLpiSTikzwRLtV3dcZc /1xO4XpDNx8srr+/kaNl0yC+erST6hcOJy5bUeWjCxDuCPuUpLanc9Zw7QH3doAp+V+M sO1oxhUwrpvOaY6NE7gb7qAakCCfzzCTMYbUjqfW7ga8tUl0uzLMKnE29FKbkdtVNy60 JXzKeE6IARvBLk60xPumVp9LHC9EQmId1ckVJ3JBe5gXh9lCyCJ06BhRcQ+9qcZr2vU3 QZMjGsjhBZ73KuT2pzwbvjhma0QCGblpk0VpZbnunBLfM+ruBqRVsbWzxEY5l7Ra3ZCr NrCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=WsIKEP1mbw5K0lCm4lLy/bWkBCAiurzAzt71iQfxPDQ=; b=zqJuFz82e8QE74TeJWk6upkTgcjGAATieiZTRihmvYogxC2ijqRoALTMb8v/+gOBZJ +IrEe2uutite0d/PYX3l8xYWHQkmKxSrx8A6Zii9poz/AsZj0TKDKkQUZ1vBa2ZOoQWh tx7CCRb2MKB5ZqJyNd0OxOvAkiJQSadeX9g9ZQgZruLS5Wx8jD4V68TFMUFt6hnuH82H QlVjh7KQwssde2iFyRanOfCuMzsed2a13JzC6kf7RBikOkgxdCqf34onDEwBsQG67Z9k YRQEHl7/ijub8BaknEi+q8kRsNrQvPdqRvAypIfXajn7wYD2hyd5zBVeJT/bGKMc3QYJ 248g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Iev1ORle; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=z6CdKNXF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v15-20020adfebcf000000b0020cca583889si3382410wrn.985.2022.05.13.20.35.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 20:35:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Iev1ORle; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=z6CdKNXF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0D716439B94; Fri, 13 May 2022 17:11:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234785AbiEKPrd (ORCPT + 99 others); Wed, 11 May 2022 11:47:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343901AbiEKPra (ORCPT ); Wed, 11 May 2022 11:47:30 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2773546175 for ; Wed, 11 May 2022 08:47:28 -0700 (PDT) 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-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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