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 B74EEC433F5 for ; Mon, 23 May 2022 04:03:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 548756B0005; Mon, 23 May 2022 00:03:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4F9076B0006; Mon, 23 May 2022 00:03:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E7246B0007; Mon, 23 May 2022 00:03:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 2F5666B0005 for ; Mon, 23 May 2022 00:03:40 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0388C20DBF for ; Mon, 23 May 2022 04:03:39 +0000 (UTC) X-FDA: 79495663800.03.725EB9A Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by imf18.hostedemail.com (Postfix) with ESMTP id 6827F1C00CA for ; Mon, 23 May 2022 04:03:23 +0000 (UTC) Received: by mail-lf1-f43.google.com with SMTP id w14so23382012lfl.13 for ; Sun, 22 May 2022 21:03:38 -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=bW8c38TBHTmvyMlXrqCJyQD8PokjGer3+J4297zdGvw=; b=mcaThTE5dBITBMOf1I3i4Cl2+VlmZiPovGLxnCuy5cWkgcunGL7C/YxSF0y6DggkXv R0uVzqeGidlnUs7ovAgpLar5Iu8ez3btY9/fbIDvmLRJHG8X1K6W+rp9vYVPwmgpwcwI UPbSkzH/KoX2ArYCODZl8ct5UU+oojXM0wIEvlfRYCYqUqhRltTtgguRYvpEIDvND1g6 sch/HcigSO1OuIruiaxkxpgiJ1eQJi9idVtVIWYemUE8jugwPxHNGf8fumqbIxL+I+hT NnouJ1Xwi1pCkLBA8r7gL/5k729DtAssUzqQKqXOdmQjx42wHjPJl0hrxzGs1DsJD8e/ Y8pA== 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=bW8c38TBHTmvyMlXrqCJyQD8PokjGer3+J4297zdGvw=; b=v8c1YFgR4BE/fxzRsEwO9LXHuc2rYsbmUrmPyUZKbR6sJo7opINddrlM5QYXOm/vTv wgKIeiYMUzdwsQ7wDkScaNQfU72mVi70A/xIAoeSY5WghdifL1gmcMn/vLEhELDdsIEL JpWU9g56xRs85k3fpv8E4exlycJqHTgMX/kng9rgkMaBxg5DuwJBFJXF7oqpqWKm2tR5 4iqGkgjmDGM/ylK4vircL5vaPZvyQZPt/z6wm5V7qP0S+8As+8fUNpn1PZsWKVkqgmxm aJA9ckmd9W6vibIry4qSf4Bu1gCFwty3cx/ocqCyIqthxT0uPLm2THMGkW7vNO4w8DOm m4PQ== X-Gm-Message-State: AOAM533SwoGxXsp10cQ5UPCbKRIrgCJEcNHY87Da2UDcLsrjqk3Kv+sf voyjI0uGrdovFioPL+8GSJ2N5Q== X-Google-Smtp-Source: ABdhPJzIdI/x9LBEDi6uVpcUNQbRCydpymBuic4N4Er1ZRdfASJDu7LBkXgCVuun8mCeH9K6wUW/JQ== X-Received: by 2002:a19:6516:0:b0:477:c159:e6b5 with SMTP id z22-20020a196516000000b00477c159e6b5mr15395297lfb.615.1653278617345; Sun, 22 May 2022 21:03:37 -0700 (PDT) Received: from [192.168.1.65] ([46.188.121.185]) by smtp.gmail.com with ESMTPSA id z4-20020a195044000000b0047844f5301asm1382188lfj.290.2022.05.22.21.03.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 May 2022 21:03:37 -0700 (PDT) Message-ID: <100d8ba9-80e4-4ba8-0568-a77f0dbd4f78@openvz.org> Date: Mon, 23 May 2022 07:03:36 +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: Steven Rostedt Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Andrew Morton , kernel@openvz.org, linux-kernel@vger.kernel.org, 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> <1621d82a-439d-0657-2b7e-5e90c42c2087@openvz.org> <20220522160943.5e5950e0@gandalf.local.home> From: Vasily Averin In-Reply-To: <20220522160943.5e5950e0@gandalf.local.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6827F1C00CA X-Rspam-User: Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=mcaThTE5; spf=pass (imf18.hostedemail.com: domain of vvs@openvz.org designates 209.85.167.43 as permitted sender) smtp.mailfrom=vvs@openvz.org; dmarc=pass (policy=none) header.from=openvz.org X-Stat-Signature: rmbgs7b1fwr93m198rcn4c41sxgr7sh1 X-HE-Tag: 1653278603-650677 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 5/22/22 23:09, Steven Rostedt wrote: > On Sun, 22 May 2022 07:33:08 +0300 > Vasily Averin wrote: > >>> slab_flags=SLAB_RECLAIM_ACCOUNT|SLAB_ACCOUNT|SLAB_STORE_USER >>> instead of just printing 'accounted=true/false'. This patch is too >>> specific to SLAB_ACCOUNT. >> >> Any extra output degrades performance. >> For my task it's not important to know SLAB flags, I just need to understand, >> is current allocation accounted or not. > > If you do save the flags in the event, you can report that on output with > the __print_flags() macro: > > TP_fast_assign( > [..] > __entry->sflags = s ? s->flags; > [..] > ) > TP_printk("... slab_flags=%s ..", > [..] > __print_flags(sflags, "|", > { SLAB_CONSISTENCY_CHECKS, "CONSISTENCY_CHECKS" }, > { SLAB_RED_ZONE, "RED_ZONE" }, > { SLAB_POISON, "POISON" }, > { SLAB_HWCACHE_ALIGN, "HWCACHE_ALIGN" }, > { SLAB_CACHE_DMA, "CACHE_DMA" }, > { SLAB_CACHE_DMA32, "CACHE_DMA32" }, > { SLAB_STORE_USER, "STORE_USER" }, > { SLAB_PANIC, "PANIC" }), ... ) > > > And you get the flag output looking nicely, and all the processing is done > on the reader path. > > That's if you find it useful at all. Thank you for explanation! Yes, we can do it however I really doubt that any other slab flags are of interest to anyone. Btw. in this form slab flags array causes sparse warnings, because SLAB_* are defined as bitwise slab_flags_t. This should be translated to unsigned long similarly to gfp_t flags. Thank you, Vasily Averin