Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp46636pxf; Wed, 24 Mar 2021 20:31:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqrXMQrOOLFNERCh4nLqUwPevDO5zbMMxs8XxcEOb4UGCWOfDbX1yFSw3ZwpxkyKxWsZLa X-Received: by 2002:a17:907:76a3:: with SMTP id jw3mr7193405ejc.353.1616643086338; Wed, 24 Mar 2021 20:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616643086; cv=none; d=google.com; s=arc-20160816; b=AxbG1uu46EQ7DDeJAOCnM/FrgjO9G3MzlzkZfyy+U9KrBGyFy4/iE6bkVwAE4Zs7V7 adGl4LTbELEd2117xmVRmdVcDehaPsiFBXSO2qAsyfK45FP+3aXz0j+oJelYRda+8gj9 M6dVCxvjtEMfxzSnuq8/yUZrue35np5GFQ6KiCxnW1/jNNFkHHuc2K4GWWIj9kRqBS1q QJo33EQcoLb2JJgMdYCydnil7JFbyms2rxDSgQEANloKpj/bLmADryrUVjR+ust7mQOl UCC52Fv65Uc51cnGDs9cPpCNTIu1Y5KvVVUVo7/18PfDhlE4oJTylbvxaoU3P/SLE0mp VCjg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jBjOzdTCI5alb7jYcViZAPDiBK1WPc+e/WGWIJGXArw=; b=YulmG59Or+pnatAd4aS1og/YsENuo4UjZyAkKydHj5VE4kvU8bR+gFXYHvLbxI3W1i KgDcfBVNwT2aGmpccYgUs3cQBdwazO+/EQimK17Yo+K20IE9r8gLoLwpcWESHPbiDk4t vc+ERYkMII4++zr8Y3ixxBg8jXOOaXRb8VgylK3uLq18qIpS9tHhVtNpC7qrTLVeqpIN e6jMPPxL9ptXo6mj2zuopaJvLejDcdze8i+dfnCvb7ugtFvov/HMyDr5hs9QMXu0IkJn huhUr2mgJzgt5Y3OW1mCAAjPHpasdGxBSlroKg93QyRH0icYfWI4kRVjarnZ3lPQ7bNW vuCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="DhrbA/tV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si3551110edj.156.2021.03.24.20.31.04; Wed, 24 Mar 2021 20:31:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="DhrbA/tV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238683AbhCXV4z (ORCPT + 99 others); Wed, 24 Mar 2021 17:56:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:41880 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231869AbhCXV4r (ORCPT ); Wed, 24 Mar 2021 17:56:47 -0400 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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