Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3626647ioo; Wed, 25 May 2022 04:57:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnDHlJnSXAR/+K2OAG7M9BAzfT/1CDVoKJ/Y7oTvvHHzl8oluEie0lMFOLmqruCQYIc144 X-Received: by 2002:a17:902:d64e:b0:163:5074:c130 with SMTP id y14-20020a170902d64e00b001635074c130mr4245628plh.125.1653479825493; Wed, 25 May 2022 04:57:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653479825; cv=none; d=google.com; s=arc-20160816; b=QcvswxpiizDwwXGhT+LUEEdGjrvShAexWOwVhLsBrPZ3bf3/KT7Hz+KvW5eNWFiCOt 2+Q8wngN1IHgzgB2j3R1MuVoPaL+4wmJK4/jSI+JYrf/uhLzxPosBOVeQ5a9Js11eEhI azK1uOtfMshYz72hXGesdAI3bHWVW6WvxaYK6F8AnIMBHQ9Y4yaAmJ/kEuTN5kXxcX/5 g8tKQah929P/VuqAJEdA3J8v/aQc1NSAhhMkJlECzwB2sENHy9AvKfOpxYFmRkx44VHy v/rWW8FKI58qmIdD5GfghzwnbPeMcK8ZZA4UXxC+8STUD24ay9JwGYECem3t9kybB/eH Bedw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=DMih3PC0CUqNRPymP7jF28Tc6uD8L1kbcREW7ZOtPzM=; b=OsTymC5CcSVd95GjS9PAXcHz/5elo+k81PeCcohoiSdXbe4gXvUP/YR8t7du00Hr8T M4G3kHxyLNlgTjySjTzRrjFeQVYViWaQOlQBfsEQM7DxbE3FwuowE6g4TqlK8NVGkJav cs9seQ/5LUkegJIdhpKi9KYABJZhxd/d5E0HS4RSBPyP5Ew3Xngxif43uq2xBH0DYUnW UwjpDxnBZmh6Shi7g0KTcS90WRNW+fH531DPYu5Gb1kCL1jygb3eNPtmubVl4MIHrf6m Ni9IwiujQUcjDybKAiLMMOiA3x1W6zlVZ+AQKvEovevlkE0mE52YEnhbY8TNrW4sI1Jl E7Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=DXRhYsse; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u5-20020a170903124500b0015696c5bda6si19522240plh.37.2022.05.25.04.56.49; Wed, 25 May 2022 04:57:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=DXRhYsse; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231494AbiEYIYJ (ORCPT + 99 others); Wed, 25 May 2022 04:24:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbiEYIYH (ORCPT ); Wed, 25 May 2022 04:24:07 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B73C6443F8 for ; Wed, 25 May 2022 01:24:06 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id i23so23648224ljb.4 for ; Wed, 25 May 2022 01:24:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=DMih3PC0CUqNRPymP7jF28Tc6uD8L1kbcREW7ZOtPzM=; b=DXRhYssez6mYWo3RiP2+AvTIdvjhEuQ4cgCcaqri67O0rmNvafyZet7dKjXHq2U/R9 kIGEoSp4H76gPv0OYfzjlJkvVLqi4Gu9lR5X/Hus5noIlybYVGg62qR1q/dXhPZB2ux4 VLG97plIRrljuc5e/GYgPBJ4TkWL9TMSJNu8103P9TcVkrawhxKg902EKfDZXJDYl+Pw Fyq14hDuVhJk5gZaskd4NiZG8Q7No4LGpgxYFS1vDKM05c7q4ButzqjpdEt1/5Xqjqto EQ2HBkrH7SQai4z0mKiNErALyj4UPusOlAXO+Hcdh6zDDcnEkz/uW28IHR00VHxMRexQ BCnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=DMih3PC0CUqNRPymP7jF28Tc6uD8L1kbcREW7ZOtPzM=; b=DeBYoFgxhZsp14MZfAUHM+YVNBKKyw8UQ4yOeGeDQHJet5YiKQ+ONr9pOsEc9hJe/u VXEzvwcWyU2x+r8KiwP49fB3cjE0NB1Ue5fja5zYktNdUNNv1bnHSjXWc9y9rmd14A/t xGsQIgn1PzRUWQkLbgsVf98n4VW0QTHTD+m1K1UnJv6K73036FnIcYGk2DlIzraKqbxl JoB0JYrXfO+C5QfYrUyBSwQcjEjNLPgW722J3hHXg5XlSPNCHCMTeMxBRLNXvU5h+2vO Kpp5AY0tjKoTqeRx2Qr6IM4+pxgZIYW11FGdrwtTA3H4kcER/hMXAkOfpfFfp9iOLT9H K7LQ== X-Gm-Message-State: AOAM533glKoeKu1LELMAZV04Vbx/h42QKLSi87fgG70Ygde2Tovf3Z5d rozdVwJJ/oLo+1hjajgP2bCe/g== X-Received: by 2002:a2e:9c88:0:b0:253:d542:6a1f with SMTP id x8-20020a2e9c88000000b00253d5426a1fmr17197661lji.499.1653467045028; Wed, 25 May 2022 01:24:05 -0700 (PDT) Received: from [192.168.1.65] ([46.188.121.129]) by smtp.gmail.com with ESMTPSA id x26-20020ac2489a000000b0047255d21111sm2976583lfc.64.2022.05.25.01.24.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 May 2022 01:24:04 -0700 (PDT) Message-ID: <54ea7fb0-69da-1a9d-1dc1-58cea852f41b@openvz.org> Date: Wed, 25 May 2022 11:24:02 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v4] tracing: add 'accounted' entry into output of allocation tracepoints Content-Language: en-US To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Andrew Morton , kernel@openvz.org, linux-kernel@vger.kernel.org, Steven Rostedt , Ingo Molnar , linux-mm@kvack.org, Shakeel Butt , Roman Gushchin , Vlastimil Babka , Matthew Wilcox , Joonsoo Kim , David Rientjes , Pekka Enberg , Christoph Lameter , Michal Hocko , Muchun Song References: <0c73ce5c-3625-6187-820e-1277e168b3bc@openvz.org> From: Vasily Averin In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 5/25/22 10:33, Hyeonggon Yoo wrote: > On Sat, May 21, 2022 at 09:36:54PM +0300, Vasily Averin wrote: >> Slab caches marked with SLAB_ACCOUNT force accounting for every >> allocation from this cache even if __GFP_ACCOUNT flag is not passed. >> Unfortunately, at the moment this flag is not visible in ftrace output, >> and this makes it difficult to analyze the accounted allocations. >> >> This patch adds boolean "accounted" entry into trace output, >> and set it to 'true' for calls used __GFP_ACCOUNT flag and >> for allocations from caches marked with SLAB_ACCOUNT. >> >> Signed-off-by: Vasily Averin >> Acked-by: Shakeel Butt >> --- > > > Maybe I worried a bit much... > > I failed to apply it on slab/for-next and v5.18. What tree is it based on? Its context depends on changes in my other patches already included into mm-unstable. >> v4: >> 1) replaced in patch descripion: "accounted" instead of "allocated" >> 2) added "Acked-by" from Shakeel, >> 3) re-addressed to akpm@ >> >> v3: >> 1) rework kmem_cache_alloc* tracepoints once again, >> added struct kmem_cache argument into existing templates, >> thanks to Matthew Wilcox >> 2) updated according trace_* calls >> 3) added boolean "allocated" entry into trace output, >> thanks to Roman >> 4) updated patch subject and description >> >> v2: >> 1) handle kmem_cache_alloc_node(), thanks to Shakeel >> 2) rework kmem_cache_alloc* tracepoints to use cachep instead >> of current cachep->*size parameters. >> NB: kmem_cache_alloc_node tracepoint in SLOB cannot use cachep, >> and therefore it was replaced by kmalloc_node. >> --- >> include/trace/events/kmem.h | 38 +++++++++++++++++++++++-------------- >> mm/slab.c | 10 +++++----- >> mm/slab_common.c | 9 ++++----- >> mm/slob.c | 8 ++++---- >> mm/slub.c | 20 +++++++++---------- >> 5 files changed, 47 insertions(+), 38 deletions(-)