Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1481516pxa; Thu, 13 Aug 2020 09:21:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxj4O5dh50piqnc7WxKaQByUJJKtxJoHvHvaVyooXggmwrplT8Aa3SpyiypLjqrs/0PEgNt X-Received: by 2002:a17:906:4bc5:: with SMTP id x5mr5723637ejv.177.1597335663734; Thu, 13 Aug 2020 09:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597335663; cv=none; d=google.com; s=arc-20160816; b=YMV0727K/XUg4mPJ450tosE7F7XTffi0xVRBw6dbRoLXWCO86Ol/0XqolwCWbU3kfS V4+jPZKUcXxBXG3Un9VV3x6wo0MUGLT3Ru7uTShATupW0v8IVmLLTyAYqA/CTZkGFBuX Ypy3UnJJRgkccsLF1GSbHMMUq1diheVoN+9V407PVVUslAuf/jOC6TZXqDCSG+GPPJmh OYBXQ3AFcGaN2oTQnIYDKcz+JF2G2bIMf6LZqzJUQDV8z9C747fG1x7mcrlU+QnNiyg1 AVgv4mIcj9XlxvO6/J/4u1QauU1MZclVfJoYs5lOn85u2WvN6OVJLDoVidQUeXZJFoc/ z0pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:from; bh=0wgEKOsyNJwBB8yzrHzXmf3Oh/ryp0JopUG8kXTB7B8=; b=rCbnAZnWc7IAszBtaCwtTgy2AIcSGWDP1mUgiFT+iAP0LQj0mrUGHTUOmAFMLMW4DM xWACinu5qvyzUwJK2d0F1Tq7jTVrSiZ+K1qmpymgMkpRlhihGTRJV+YOiqqT4F4rEDof 4tOqHomDDe/C/sFix7mgu7OMIl+gd2JtaQzXSYDqORh0VcIfcdyZ3aT+gByeoIk277rZ qLU5+Bu/e5r8SdYw4kP0u1wY3oxoLp7iWvVGTHMQzRi/zj45ngkJQD1ZfU8RvU9Pz1SV gUUzZH4aHSRd0otgB/ZUnsDzgLDzYEtjyT3/yLK1JmRUKziYRHxoyZewAGi5TFOG1TKR 8Ifg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dc15si3490596ejb.285.2020.08.13.09.20.37; Thu, 13 Aug 2020 09:21:03 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726837AbgHMQTe convert rfc822-to-8bit (ORCPT + 99 others); Thu, 13 Aug 2020 12:19:34 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:41098 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726167AbgHMQTc (ORCPT ); Thu, 13 Aug 2020 12:19:32 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-144-HFvdjctTMHyprBW8119_ew-1; Thu, 13 Aug 2020 17:19:28 +0100 X-MC-Unique: HFvdjctTMHyprBW8119_ew-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 13 Aug 2020 17:19:28 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Thu, 13 Aug 2020 17:19:28 +0100 From: David Laight To: 'Josef Bacik' , "hch@lst.de" , "viro@ZenIV.linux.org.uk" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kernel-team@fb.com" Subject: RE: [PATCH] proc: use vmalloc for our kernel buffer Thread-Topic: [PATCH] proc: use vmalloc for our kernel buffer Thread-Index: AQHWcYF4YUlfHEUFrEai+1gWcwt4Jak2N4WQ Date: Thu, 13 Aug 2020 16:19:27 +0000 Message-ID: <714c8baabe1a4d0191f8cdaf6e28a32d@AcuMS.aculab.com> References: <20200813145305.805730-1-josef@toxicpanda.com> In-Reply-To: <20200813145305.805730-1-josef@toxicpanda.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ...' ? David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)