Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3377599iob; Mon, 16 May 2022 21:14:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlYwQCL3odW3rEq9tfC8M1dvV8XIxqhoE+FHf8WbX/2UwLnS2araI1MNH4GesWJA7r3eDS X-Received: by 2002:a17:90b:33ce:b0:1dc:690e:acef with SMTP id lk14-20020a17090b33ce00b001dc690eacefmr33640122pjb.121.1652760867496; Mon, 16 May 2022 21:14:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652760867; cv=none; d=google.com; s=arc-20160816; b=W50Pu0vRdQQpgO5MI2rfgBmN9hnlBO0KEsCscM5UmJR9CHnty+XOZ9AAVcqN9XlCKP /iKPOthQyPucT5b9WhIcSsE6isDqyWEidoGA+YBxzB95oL433FpX+hfn354ZpZWb2SsN Ie7PFVnWReBUZjgqrIN7TX6gVH5n+VZaSPGR6qTWDA9ud/BCwhvktobWPxHIhmIELBbi USuCC410HdIvKz5wFEQbQEmF+O6ssmj93WfAR+a3i4QwrQObB37aXJ0j4L/ASxHzcpbU YMXS+GkadtDmxGz89z0FoXdH69tZpKvnPCe2klxqrHL7+xyKlhApkDQjRmo2gQ3phdi0 kfJw== 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=ER2JX2zn+fukFDj6cClopw15+MZZU+3In4sQBn9YEFk=; b=NfR0+s3muhbyFPCE7HX5X8sg5GAuynyZ0x0CeN6AKQOHj6xoPHAQh6uN/0R616qjVx PtHXZHbpDzGOIZv8yVaqus7NqOpkLVKUEnHvzM5QROO/b6/eGiXk1WyoZKQAdlmakTTu ZxkpBkutLPxqIMTFJMbkOkq2gmBXSsEF8lPaaGdrh57qSA1eSwjQTCbi2gtse1C+NRqE YF+P0K3p92NBXLhDwpiuuniCkZmI0EhD9Z4YKCbggMADT+cS1FPHQhJrglDGXZ+uXOPm rO9iFUOb9yQGTalyNWgUx8qGpNMmW2pA3ehbFWtFE3JYfJpwTbqGspComA4NbuWG72Fl JgYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=NGkGnmfB; 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 x11-20020a1709029a4b00b0015d180d0710si14439632plv.26.2022.05.16.21.14.14; Mon, 16 May 2022 21:14:27 -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=NGkGnmfB; 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 S233714AbiEQDcf (ORCPT + 99 others); Mon, 16 May 2022 23:32:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232254AbiEQDcd (ORCPT ); Mon, 16 May 2022 23:32:33 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C85ED3D1ED for ; Mon, 16 May 2022 20:32:31 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id j4so29064696lfh.8 for ; Mon, 16 May 2022 20:32:31 -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=ER2JX2zn+fukFDj6cClopw15+MZZU+3In4sQBn9YEFk=; b=NGkGnmfB5hvf424RmyFYy0K3036u5k8OG3f+rE/p8W6RGg8LrqLjoJxzhtgxQyotps 5iy548Kd43P0+luHulBEo7p59aoSKmB5FhinQ1LWqfQQ8/ynOgjgb1/+Uep1XAuI5cxR HgcmxcXE1cGRyXj36GkUFF++kXN+XchmJqgFSu940B8AqNajhzliO237KUje42Yp6z8N 578LoRGdb6BrtYVYr8vLUjUXkA5a17N90mV6LZdi/V8tsxEeHjPBySZrhykMpctrnUoF 88Gy9aMJYmgqpy3RyNWQ3Xz/1JG2DpE1J81w/ZL6w9PDRjaOeT4tQIl4HwFIiyQQIU6c KXPw== 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=ER2JX2zn+fukFDj6cClopw15+MZZU+3In4sQBn9YEFk=; b=RKcidsBPIJqH96lVGClzhQyKbDO5Qv/t/pSiUR0LZEUKbsT1eBUL1XFHvkqr+ayHRC kUlWgFzr+F8DVAQdbtdFBuosZfzpq9j54AUTR0kkO2Z4kBYZ52QCCV6J79CWvup7OkeR h9kWTihcklHyIBcuKmnm6sRhzIF9ZdM99D06KOygR+EKovzEkEx0zSVVTXUHKlHIoDIK 0ANnh12ILTbKa8jdvucdGM+mwg0xcTym/RV+NMihaN4pphZCFmJNlUJCkzNwtnQXkQmS QU0v5n14vUed1/iiytIZ+NKbL6wMyp+MIR32fMX+gNRVPA6ETSMS4bDaCVEbrSiiI2Lo dFXQ== X-Gm-Message-State: AOAM530mfXUvjrnOmZV3LFqWIGJJYkTAcOZ1EKW3kcX79CTVdBxJBzO7 +cNA5Kf1TzD7YWPbTnWFaVdHhA== X-Received: by 2002:a05:6512:ba9:b0:477:9e15:a6ec with SMTP id b41-20020a0565120ba900b004779e15a6ecmr1639004lfv.315.1652758350166; Mon, 16 May 2022 20:32:30 -0700 (PDT) Received: from [192.168.1.72] (46-138-221-128.dynamic.spd-mgts.ru. [46.138.221.128]) by smtp.gmail.com with ESMTPSA id x4-20020a2e9c84000000b0024f3d1dae8esm1746972lji.22.2022.05.16.20.32.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 May 2022 20:32:29 -0700 (PDT) Message-ID: <0aaf7b6d-6ed7-45ca-873e-394718f73c9a@openvz.org> Date: Tue, 17 May 2022 06:32:28 +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] tracing: add ACCOUNT flag for allocations from marked slab caches Content-Language: en-US To: Shakeel Butt Cc: Roman Gushchin , Vlastimil Babka , Andrew Morton , Joonsoo Kim , David Rientjes , Pekka Enberg , Christoph Lameter , kernel@openvz.org, Linux MM , LKML , Michal Hocko References: <1fd21e25-b095-e055-fc2e-abda640a0575@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.3 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/16/22 22:10, Shakeel Butt wrote: > On Mon, May 16, 2022 at 11:53 AM Vasily Averin wrote: >> +++ b/mm/slab.c >> @@ -3492,6 +3492,9 @@ void *__kmem_cache_alloc_lru(struct kmem_cache *cachep, struct list_lru *lru, > > What about kmem_cache_alloc_node()? Thank you for the hint, I was inaccurate and missed *_node. >> { >> void *ret = slab_alloc(cachep, lru, flags, cachep->object_size, _RET_IP_); >> >> + if (cachep->flags & SLAB_ACCOUNT) > > Should this 'if' be unlikely() or should we trace cachep->flags > explicitly to avoid this branch altogether? In general output of cachep->flags can be useful, but at the moment I am only interested in SLAB_ACCOUNT flag and in any case I would prefer to translate it to GFP_ACCOUNT. So I'm going to use unlikely() in v2 patch version. >> + flags |= __GFP_ACCOUNT; >> + >> trace_kmem_cache_alloc(_RET_IP_, ret, >> cachep->object_size, cachep->size, flags); >> Thank you, Vasily Averin