Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1242383lfc; Wed, 1 Jun 2022 12:51:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJCUz3uXgpZuHK/5yN3ExlOYjihe+Y1rCYc/Oh3yxjHDzxpb9qcnTl+l/9zWyjSooXb123 X-Received: by 2002:a17:902:f685:b0:161:8df3:7f50 with SMTP id l5-20020a170902f68500b001618df37f50mr1068424plg.106.1654113062596; Wed, 01 Jun 2022 12:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654113062; cv=none; d=google.com; s=arc-20160816; b=Mzy1KhaTy4xeQFDy0khxIHn0V6TGGuUQBFNLMVFxutWZh/p38LrcvWJqGCwisOhVAd METhx9BHFZOcEPGBP1Y1yWgRYHx5L6Lab6VvQOiEVKGgQE0/hEgLajmIMa5c7RhfvrXb 2vqKDYLHNjf4HLCuWNB7CjWq4OUTlmiFtfxWoFYPCnNClMX5DdGt2uHt0PSLZ4t2dL1F TkR3n9LGoEOkxvVTrp13XkfDo/AiXE67noccopeBQCiI7M3l6e+z6B790fhiGQjc/SMJ sovQoCrncssOE9yd7psULHlsg6HIBaJMm/GFUKbbJ6GXmG4iVNvMiGTwbbhcpswCXbeC wkpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=CB6nenvc4Q7BEMpp6MQlYugf0znrhzS7++vofqJ7nxE=; b=NOpMAmVT44T11aNoI3E7GNerwMOSQqdsrATRniT0G/7vuShOudyO1VJyt2NerBJHCi FI33OKt7VQbAlLSm5WoVtvv7seAezAlLBkmJ9oxL4Vx8JlEieCSleUxrRfHJOUfvXPRE 9+mo+MCAUUGO5qzJFsvGrnjzWk3xTYrNvofxJpkP6K4jm71Uz/ysPDAudi5J9OFLvieh ixE9GVhxX5qoS8ZBBW+fNZ1UKS53tRu1c90Qxzy3rrNqy9lnteDsD0K8D7H6p2NS/1d+ zHrPdDh97+PZphze41HO9wuP5/N7dq/GPv1zPZM0wHDbHwIN1xCicaTLlp01kHGpxq+T IT0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mXlSXKTp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d18-20020a17090abf9200b001d97a68ce61si394208pjs.172.2022.06.01.12.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 12:51:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mXlSXKTp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5289E1F6B4E; Wed, 1 Jun 2022 12:13:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344487AbiEaPOT (ORCPT + 99 others); Tue, 31 May 2022 11:14:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237336AbiEaPOR (ORCPT ); Tue, 31 May 2022 11:14:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A9B125F0; Tue, 31 May 2022 08:14:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 112FDB8119C; Tue, 31 May 2022 15:14:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E149C385A9; Tue, 31 May 2022 15:14:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654010053; bh=gDp6UNdQ0PKd5CJVOD3E4KkUjLefxtxl9Ek4Nl2FAww=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mXlSXKTpzFFbquqZzqwvtnvCZhcVvGXl02PY5LezepuGRt4lhTakVtteFtu/fd9Uq tZFcfHkNDgyAnRcl5DFxYGxLIM7H1LBOFKqLq9P7sm98S4N+5UnWlFfdQxiZxz7Ucd UJ+lOZhhh026r3qFAob+L+00lWT0uBs5gzXahsvg3pGIz0MFSQEcoYgbK8z9fzHlV0 inW42vMBYRZHhhKKqQ2j6Crh4ojGJo+BaSTHH26CkDTVfZv9GDSypjBwJhSqkY8mZj 5zTz40yuIzjyPwtFikCybZmKtk4bs9TcD/XjmEQOIUbmcBBVzZYCNE801MhFRULDX0 JeF0EOrwiek6g== Date: Tue, 31 May 2022 08:14:12 -0700 From: Jakub Kicinski To: Chen Lin Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, alexander.duyck@gmail.com, netdev@vger.kernel.org Subject: Re: [PATCH v2] mm: page_frag: Warn_on when frag_alloc size is bigger than PAGE_SIZE Message-ID: <20220531081412.22db88cc@kernel.org> In-Reply-To: <1654008072-3136-1-git-send-email-chen45464546@163.com> References: <20220530122918.549ef054@kernel.org> <1654008072-3136-1-git-send-email-chen45464546@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_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, 31 May 2022 22:41:12 +0800 Chen Lin wrote: > At 2022-05-31 02:29:18, "Jakub Kicinski" wrote: > >Oh, well, the reuse also needs an update. We can slap a similar > >condition next to the pfmemalloc check. > > The sample code above cannot completely solve the current problem. > For example, when fragsz is greater than PAGE_FRAG_CACHE_MAX_SIZE(32768), > __page_frag_cache_refill will return a memory of only 32768 bytes, so > should we continue to expand the PAGE_FRAG_CACHE_MAX_SIZE? Maybe more > work needs to be done Right, but I can think of two drivers off the top of my head which will allocate <=32k frags but none which will allocate more.