Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp195834rwr; Thu, 4 May 2023 01:16:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4F6wUv4sq5KMjUn8tH0H8oRAHnYFa8nHhdwsnc+mGUAxJVAiMTHE9eFrkq1c//Q+3wA6Pu X-Received: by 2002:a05:6a20:94c6:b0:ef:7b11:3ae with SMTP id ht6-20020a056a2094c600b000ef7b1103aemr1339862pzb.52.1683188201112; Thu, 04 May 2023 01:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683188201; cv=none; d=google.com; s=arc-20160816; b=txH9Vju9l+x06xpa4tyQRUFhEOyCX/69YfrgqfpIigzX87IBy+DAlALG4qjubXud+Y Xa09AnSYcYbb4JnXlT+CJ5xtvzubyadVomC3lLlsl1xP2pVOdQhm4RQO4Re593D0eBMf GtS6yrIYeP+Vs9Q6qUpX910nqelk47kMvAl1OkrgVSXR9t+3K/FHsSKlphfAXlYZul1X n6FTiR0cZcc1bo801Uc2uIAogB2LSG1tzzn3JeMp7BVPyWMJjtAxjsFtyDLmoXTiHin4 XH93YR9XBC5h5hYfQ2emX3yFH9sHymh1TRiYQL+xmjs1G+yzZjUT2ZCynchA+klgpB/Z 2CrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=H0f9aUoTiM+sJjdWNgkunI1DxI6aESt6W4qyqw6LAGM=; b=PxWqjN/A4lWnSpLupNBCF3FDiBmvuMVQ0+tt0DAGwlagpW/1MpMkxtKzWXqF7RDWB/ kFtKxb9/bUMLmdo5R0HAJEIeDJzF9VeyIZlyl1/hWmwnYEcvG2z+oSz+JjERcYCTvg9d 2Y8sftZ6Pi/DRdoPosg58zATV07qd/ArruX/W71vgL185TbD4g8d7GYX+XoDtUpV9GtR OEbYHAIDwS7zwxOIzIv8iGjkW19XKYxX2Ogoy/n8CurPcJh8uB9Va9c1Ev+pme2yxf3c HjojZTQlKtP2Tw+U9uhDywDn08ADjGGLNdif7zgj39IHI3WvS+93k8Zo5yYQRxE0lek/ wKYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=pWdGUIdH; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q1-20020a634301000000b00528595a1390si24642335pga.588.2023.05.04.01.16.27; Thu, 04 May 2023 01:16:41 -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=@suse.com header.s=susede1 header.b=pWdGUIdH; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230341AbjEDINi (ORCPT + 99 others); Thu, 4 May 2023 04:13:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230223AbjEDIMW (ORCPT ); Thu, 4 May 2023 04:12:22 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25C99128; Thu, 4 May 2023 01:10:00 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D6F14338E2; Thu, 4 May 2023 08:09:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1683187798; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H0f9aUoTiM+sJjdWNgkunI1DxI6aESt6W4qyqw6LAGM=; b=pWdGUIdHnc7pXvP6bdU3/IRv7Ifbi1CA0lQX+z9/n34tBigeeWwOZDECe8lz33AC0mNuHl AQdkuJamTlc3SfQd1m0hniHdcNs/5uk7Udyj1zoIuvzn0qfUFiaTx3hK+ZExAUDSxsNTzp xfg6Wx9ZGfIrh+ttMaaBChPygRSla+0= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A6BA4133F7; Thu, 4 May 2023 08:09:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id BMewJ1ZoU2QKLAAAMHmgww (envelope-from ); Thu, 04 May 2023 08:09:58 +0000 Date: Thu, 4 May 2023 10:09:57 +0200 From: Michal Hocko To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, kent.overstreet@linux.dev, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, ldufour@linux.ibm.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, keescook@chromium.org, ndesaulniers@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org Subject: Re: [PATCH 35/40] lib: implement context capture support for tagged allocations Message-ID: References: <20230501165450.15352-1-surenb@google.com> <20230501165450.15352-36-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Wed 03-05-23 08:24:19, Suren Baghdasaryan wrote: > On Wed, May 3, 2023 at 12:39 AM Michal Hocko wrote: > > > > On Mon 01-05-23 09:54:45, Suren Baghdasaryan wrote: > > [...] > > > +struct codetag_ctx *alloc_tag_create_ctx(struct alloc_tag *tag, size_t size) > > > +{ > > > + struct alloc_call_ctx *ac_ctx; > > > + > > > + /* TODO: use a dedicated kmem_cache */ > > > + ac_ctx = kmalloc(sizeof(struct alloc_call_ctx), GFP_KERNEL); > > > > You cannot really use GFP_KERNEL here. This is post_alloc_hook path and > > that has its own gfp context. > > I missed that. Would it be appropriate to use the gfp_flags parameter > of post_alloc_hook() here? No. the original allocation could have been GFP_USER based and you do not want these allocations to pullute other zones potentially. You want GFP_KERNEL compatible subset of that mask. But even then I really detest an additional allocation from this context for every single allocation request. There GFP_NOWAIT allocation for steckdepot but that is at least cached and generally not allocating. This will allocate for every single allocation. There must be a better way. -- Michal Hocko SUSE Labs