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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15BB4C77B7C for ; Thu, 4 May 2023 08:13:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230339AbjEDINi (ORCPT ); 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: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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