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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01071C433C1 for ; Wed, 24 Mar 2021 21:56:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 865CF61A1E for ; Wed, 24 Mar 2021 21:56:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 865CF61A1E Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1AE5C6B0323; Wed, 24 Mar 2021 17:56:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 15F396B0325; Wed, 24 Mar 2021 17:56:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F417A6B0326; Wed, 24 Mar 2021 17:56:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0213.hostedemail.com [216.40.44.213]) by kanga.kvack.org (Postfix) with ESMTP id D7AE96B0323 for ; Wed, 24 Mar 2021 17:56:47 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 9700E83E3 for ; Wed, 24 Mar 2021 21:56:47 +0000 (UTC) X-FDA: 77956128054.11.CBFC51C Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf06.hostedemail.com (Postfix) with ESMTP id CDE3DC0001FE for ; Wed, 24 Mar 2021 21:56:46 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1616623005; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jBjOzdTCI5alb7jYcViZAPDiBK1WPc+e/WGWIJGXArw=; b=DhrbA/tVqf9uCoYm4s7RQxVbZPoHrfzVoKYTZe87BQllvWidEXlh2nk2bx0rbdUBodEtxv 5MBMLQBq0AIVRlf6aApbV2mL3MSvYgoyvNbqO9iFWLZuFRNTjg+XolcmEzIdFIurCL1f0e gX4q/hXAT+x+6J8muKJK9agDrBMHc5U= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 8E2D4AB9B; Wed, 24 Mar 2021 21:56:45 +0000 (UTC) Date: Wed, 24 Mar 2021 22:56:44 +0100 From: Michal Hocko To: Shakeel Butt Cc: Arjun Roy , Johannes Weiner , Arjun Roy , Andrew Morton , David Miller , netdev , Linux Kernel Mailing List , Cgroups , Linux MM , Eric Dumazet , Soheil Hassas Yeganeh , Jakub Kicinski , Yang Shi , Roman Gushchin Subject: Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy Message-ID: References: <20210316041645.144249-1-arjunroy.kdev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: CDE3DC0001FE X-Stat-Signature: 9d17ymawh1otafhwzisbdxu4w9iud4ar Received-SPF: none (suse.com>: No applicable sender policy available) receiver=imf06; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616623006-472671 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 Wed 24-03-21 13:53:34, Shakeel Butt wrote: [...] > > Given that's the case, the options seem to be: > > 1) Use a page flag - with the downside that they are a severely > > limited resource, > > 2) Use some bits inside page->memcg_data - this I believe Johannes had > > reasons against, and it isn't always the case that MEMCG support is > > enabled. > > 3) Use compound_dtor - but I think this would have problems for the > > prior reasons. > > I don't think Michal is suggesting to use PageCompound() or > PageHead(). He is suggesting to add a more general page flag > (PageHasDestructor) and corresponding page->dtor, so other potential > users can use it too. Yes, that is eaxactly my point. If there is a page flag to use for a specific destruction then we can use an already existing scheme. I have fully digested Johannes' other reply so I might be still missing something but fundamentally if sombody knows that the particular part of the page is not used (most really should) then the page can claim destructor by a flag and the freeing routine would just call that callback. Or is there any reason why othe subsystems outside of networking couldn't claim their own callback? -- Michal Hocko SUSE Labs