Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1897994pxk; Tue, 1 Sep 2020 10:17:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwY/7vrNDY0RYpcRPtcn7W31llGWaC2rYG+B0ss7D3W1mMXMnwvBoSrm2vCNZyEJhsyj7C4 X-Received: by 2002:aa7:ce81:: with SMTP id y1mr2668912edv.51.1598980666497; Tue, 01 Sep 2020 10:17:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598980666; cv=none; d=google.com; s=arc-20160816; b=OqDuTp4xYpLDJIlqg+Q1cjqdYQT3JsTEX+j43Ybga8Oz3Fnf/VQ5aMF8YhRurn2W2q 8mMde+lJEoaaYhFP46YUeLT0m5b6zvXmXHxwXaTu73ilP40nnbskFoSSJjyBk7Oz4PA7 bMcbwX04KshG0WmypYUj1uVgKCyNnMYRyGQMV/PupqzFo1DxJl18ZiLTekaMHchaTrYw AiRKkM/DRg/2Gb4Irg/w/ftKRU+1mgRuAnaYxtI5GNGC9rw/Ydz+zhWcIlZaVxPRJoNB 2OkbtthSlfFIORQQOL+LHAkPqU8ahB/pLr+KlB7e6N3H1YGvAZVOA4jA6Gz5jfUpJI7X 8KSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=tasbgl+JTn9wJkvrc6o6PQRjZTO5hEPWivkX5VhHVMo=; b=PTM9nuO9aiPX8W6a5Rpp3J6nmlZHrkWf1jsc+rnskjhVPwlkX7tdLs2oaIPnBqr5IV dptappGx7w0Xt4oUnwk4UPex4eQiv5qpsFM/Mkz4JdUbUcuwnHkQHzrrRwMxgOUg/Bjm V28jxPvCNHTbgsScymLo5cdee3IrWlmA18ldAxyR7e5A4YiwKq6/zAgT9adgsBFwZ2fM /neAoGH7D4+4mHIzQhm4yXoDgfWEDQZCVatZrsrnOftLJUt7OoTH+0atiSVeS0jqay1U 6OZyqxvonnINOnQtTd6F1RjZCmNW3Q/9aEcBud8CATnD4dYCng/iq6TUbhKDPbD7Fl3p XpcA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c7si1020901ejz.677.2020.09.01.10.17.22; Tue, 01 Sep 2020 10:17:46 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732589AbgIARQv (ORCPT + 99 others); Tue, 1 Sep 2020 13:16:51 -0400 Received: from verein.lst.de ([213.95.11.211]:53770 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728585AbgIAPOX (ORCPT ); Tue, 1 Sep 2020 11:14:23 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 0183E68B05; Tue, 1 Sep 2020 17:14:21 +0200 (CEST) Date: Tue, 1 Sep 2020 17:14:20 +0200 From: Christoph Hellwig To: Josef Bacik Cc: hch@lst.de, viro@ZenIV.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, willy@infradead.org, kernel-team@fb.com Subject: Re: [PATCH 1/6] proc: use vmalloc for our kernel buffer Message-ID: <20200901151420.GA30709@lst.de> References: <20200813210411.905010-1-josef@toxicpanda.com> <20200813210411.905010-2-josef@toxicpanda.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200813210411.905010-2-josef@toxicpanda.com> User-Agent: Mutt/1.5.17 (2007-11-01) 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 05:04:06PM -0400, Josef Bacik wrote: > Since > > 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. Maybe the subject should read ".. also use vmalloc" as we still default to kmalloc for small allocations? Otherwise looks good: Reviewed-by: Christoph Hellwig