Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp12121218rwd; Fri, 23 Jun 2023 01:27:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ50D3Qvrn1fcpONgSgnRtzNQM+Ii5VCaQ/ZidYOdCrcuu5xdZbg1P0trPeoBt/QrgPWgbCB X-Received: by 2002:a17:902:bc42:b0:1ae:8892:7d27 with SMTP id t2-20020a170902bc4200b001ae88927d27mr18561292plz.42.1687508857316; Fri, 23 Jun 2023 01:27:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687508857; cv=none; d=google.com; s=arc-20160816; b=KraiOQ/rAJ9Jl7Q55YyKRRUVvcu9BLfzz/Tx01+VlX0j1hqil/ACf/r8hmVwW4n/sc UE0x3VOpj6907hOd+1du4Kvnc5LtVEvGA2mBdfq3tgYwWV2gpGNypmFrhfYeytTXKVUD DExuk/UaYaXWE5OGKTVE/OVeBSdCdHm3D+ZcL5wNIwgpNaQm8qSPCl8zE5/PKivWtuN+ ZJc9HFah4Bxmr6rObXkkMSWAVuHfSd5g+IOVRB6mc/2ScsZDoYzWTPn8OuiOMM/tX78j zjH+XHKOSQjekeqJSsIJ5ntgNxcO1mYCemBmdfGMA1akU2tF8X4yeLfEACqV+x/QCFRH snbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=PkaQxx+Y1hANa87C64UPOn1w6sw0j2xvZ0R3DPOEvLI=; b=b+vYrXfTj6zeIAN8BiHiy6LlKfhdge6uJ/0VGmLzddOi1a8/lLWYYYe2OTSQmeLwS6 FIvhnWq9fOt887sHTMiSTIWnO0FT1Z9QbK3XPNu3OHYUefc3borgaMFkWk8eIJAw4Rki /ik8hYLNV6lEqS1pwKOyAM39SbNI7Z479vT9sOFrzsI7TOGqLZU2Y5Exepjxf38jaQbS CpOZk+4b/kw6dMw9Ks9Jk2jobNLFr5qGpVCC4pViGFdslbKjHM+KXVk9E/775bR61cYM AnmyLJoOZ16qYTIDTSexR1zUkRlcJQB/+qoIFUmo4rUveOym1vdYdZy6TdtEhBpMz/oS NFbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=clVftSn6; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id le8-20020a170902fb0800b001b02d0941dfsi7798397plb.354.2023.06.23.01.27.24; Fri, 23 Jun 2023 01:27:37 -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=@redhat.com header.s=mimecast20190719 header.b=clVftSn6; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231834AbjFWITZ (ORCPT + 99 others); Fri, 23 Jun 2023 04:19:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230387AbjFWITW (ORCPT ); Fri, 23 Jun 2023 04:19:22 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24522118 for ; Fri, 23 Jun 2023 01:18:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687508316; h=from:from:reply-to:subject:subject: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=PkaQxx+Y1hANa87C64UPOn1w6sw0j2xvZ0R3DPOEvLI=; b=clVftSn6OMIAYMDeWdfaH55xpUnacHkxiEIB3viosNWPDbG8DZTvyrRXkFSRBOWBnjyKsW y3wdNHjtRladMhXmwHq34HO2k7MuYtENc4KJl161eRjAxQ8qAerwqXp9MRFk2c9bPF2sbi DwSU6+spNUFYgnJ8SSG/9Iu77DMvK48= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-345-8aQGnOAcMEmB_jRvFaqZBQ-1; Fri, 23 Jun 2023 04:18:29 -0400 X-MC-Unique: 8aQGnOAcMEmB_jRvFaqZBQ-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-62ff7a8b9aeso928166d6.1 for ; Fri, 23 Jun 2023 01:18:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687508308; x=1690100308; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=PkaQxx+Y1hANa87C64UPOn1w6sw0j2xvZ0R3DPOEvLI=; b=fjjPQ4scoo2rRVtVNQyx1ENgUUKwpK89LSCMp2r8RsK7qymWQfllOhSBmoiHfHZ3xD W9AILHqb5tmRmaMUqFDcl7xgg3ZG4VcQcxZoPxAGJwiJbgeMc1BWNH5qHL4Yyue6UrlG DPeYRS1RVv+YCVNmItkrEZDb4CL5VNAGO1nTGKo4AMilv9xBqJCQtdL4qo6IvDnDLu9m O/18W0UCfm5tPIz9tgrtNhsSvLTIibp2fa49JVoSERHKXRf7VXCHmRTKCqcbGkxRjk6V HwSxhvnaoFgvWtSMDmWr4YUoR9Hc+qW25c7em4L6LXIdx4vPWv0yBmFdAcIEYtLt5GHl oBtQ== X-Gm-Message-State: AC+VfDzwnAnsT8dkuTJ8yDSV2dPpq0qicfCwEGmjeZvn/sDwmWXJ1QYs f1pbMnP0ab6VP0G5Q7tSeBGNlDAWQbE66utHB3QUGyx+FgpaJjfMo4fuiZg2l+euc73gMFQ4qx+ NALWAyj1x/t9xgkwZk3Ef7Cbx X-Received: by 2002:a05:6214:2426:b0:62f:e386:1e45 with SMTP id gy6-20020a056214242600b0062fe3861e45mr23780094qvb.1.1687508308657; Fri, 23 Jun 2023 01:18:28 -0700 (PDT) X-Received: by 2002:a05:6214:2426:b0:62f:e386:1e45 with SMTP id gy6-20020a056214242600b0062fe3861e45mr23780085qvb.1.1687508308351; Fri, 23 Jun 2023 01:18:28 -0700 (PDT) Received: from gerbillo.redhat.com (146-241-231-243.dyn.eolo.it. [146.241.231.243]) by smtp.gmail.com with ESMTPSA id m1-20020a0ce6e1000000b006238b37fb05sm4759922qvn.119.2023.06.23.01.18.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 01:18:28 -0700 (PDT) Message-ID: <2ee000f803bd1a099aa8fb02ef79c7b25e5f5b08.camel@redhat.com> Subject: Re: [PATCH net-next v3 02/18] net: Display info about MSG_SPLICE_PAGES memory handling in proc From: Paolo Abeni To: David Howells , netdev@vger.kernel.org Cc: Alexander Duyck , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Willem de Bruijn , David Ahern , Matthew Wilcox , Jens Axboe , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Menglong Dong Date: Fri, 23 Jun 2023 10:18:24 +0200 In-Reply-To: <20230620145338.1300897-3-dhowells@redhat.com> References: <20230620145338.1300897-1-dhowells@redhat.com> <20230620145338.1300897-3-dhowells@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Tue, 2023-06-20 at 15:53 +0100, David Howells wrote: > Display information about the memory handling MSG_SPLICE_PAGES does to co= py > slabbed data into page fragments. >=20 > For each CPU that has a cached folio, it displays the folio pfn, the offs= et > pointer within the folio and the size of the folio. >=20 > It also displays the number of pages refurbished and the number of pages > replaced. >=20 > Signed-off-by: David Howells > cc: Alexander Duyck > cc: Eric Dumazet > cc: "David S. Miller" > cc: David Ahern > cc: Jakub Kicinski > cc: Paolo Abeni > cc: Jens Axboe > cc: Matthew Wilcox > cc: Menglong Dong > cc: netdev@vger.kernel.org > --- > net/core/skbuff.c | 42 +++++++++++++++++++++++++++++++++++++++--- > 1 file changed, 39 insertions(+), 3 deletions(-) >=20 > diff --git a/net/core/skbuff.c b/net/core/skbuff.c > index d962c93a429d..36605510a76d 100644 > --- a/net/core/skbuff.c > +++ b/net/core/skbuff.c > @@ -83,6 +83,7 @@ > #include > #include > #include > +#include > =20 > #include "dev.h" > #include "sock_destructor.h" > @@ -6758,6 +6759,7 @@ nodefer: __kfree_skb(skb); > struct skb_splice_frag_cache { > struct folio *folio; > void *virt; > + unsigned int fsize; > unsigned int offset; > /* we maintain a pagecount bias, so that we dont dirty cache line > * containing page->_refcount every time we allocate a fragment. > @@ -6767,6 +6769,26 @@ struct skb_splice_frag_cache { > }; > =20 > static DEFINE_PER_CPU(struct skb_splice_frag_cache, skb_splice_frag_cach= e); > +static atomic_t skb_splice_frag_replaced, skb_splice_frag_refurbished; (in case we don't agree to restrict this series to just remove MSG_SENDPAGE_NOTLAST) Have you considered percpu counters instead of the above atomics? I think the increments are in not so unlikely code-paths, and the contention there could possibly hurt performances. Thanks, Paolo