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=-4.0 required=3.0 tests=BAYES_00, 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 DDEDAC433DF for ; Thu, 13 Aug 2020 16:21:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C122920855 for ; Thu, 13 Aug 2020 16:21:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726621AbgHMQVq (ORCPT ); Thu, 13 Aug 2020 12:21:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726167AbgHMQVp (ORCPT ); Thu, 13 Aug 2020 12:21:45 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD77FC061757; Thu, 13 Aug 2020 09:21:44 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k6Fz3-00EzMC-U0; Thu, 13 Aug 2020 16:21:41 +0000 Date: Thu, 13 Aug 2020 17:21:41 +0100 From: Al Viro To: David Laight Cc: 'Josef Bacik' , "hch@lst.de" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kernel-team@fb.com" Subject: Re: [PATCH] proc: use vmalloc for our kernel buffer Message-ID: <20200813162141.GY1236603@ZenIV.linux.org.uk> References: <20200813145305.805730-1-josef@toxicpanda.com> <714c8baabe1a4d0191f8cdaf6e28a32d@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <714c8baabe1a4d0191f8cdaf6e28a32d@AcuMS.aculab.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 13, 2020 at 04:19:27PM +0000, David Laight wrote: > From: Josef Bacik > > Sent: 13 August 2020 15:53 > > > > sysctl: pass kernel pointers to ->proc_handler > > > > we have been pre-allocating a buffer to copy the data from the proc > > handlers into, and then copying that to userspace. The problem is this > > just blind kmalloc()'s the buffer size passed in from the read, which in > > the case of our 'cat' binary was 64kib. Order-4 allocations are not > > awesome, and since we can potentially allocate up to our maximum order, > > use vmalloc for these buffers. > > What happens if I run 'dd bs=16M ...' ? Try it.