Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6642517ybf; Fri, 6 Mar 2020 01:38:00 -0800 (PST) X-Google-Smtp-Source: ADFU+vs218PVjpT8u+K96VL4ohE5lcjCyvjbH6ZJn4AGSZNlk2Z7vuAUX+fO7AB/4rhcwnjj9j+d X-Received: by 2002:aca:230f:: with SMTP id e15mr1980600oie.54.1583487480682; Fri, 06 Mar 2020 01:38:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583487480; cv=none; d=google.com; s=arc-20160816; b=ZqD/SDQqP7cwCIwG8ud2AmkpXb3Wtx7CO5FiWS20oIMsC3AgF+ZnnZdijITS8m48XR aeZbfdj6FwLTO09uO1CYw8xVaGnWMwvZ7VZTW+2c+D3jGPu9n/fyZdgNyhzOmzUL2464 tWLosI3xxuNL8AclhoB2cakGBxtygeN/HovbZA5cc/sgDLpPb/YTcKLaU0Ic4aIUkIts RjpOMKOF+Jk3sJMw71PANOFkm7ly7VvNPrbQGwwm70vCLqea9Ykf+qoxxhiL8lwjHwtc X5lgVSRGYfATtKPv1Y+nopLUIm4p5TwIC5QnHiDmfRZ/KrUw+7ZxUf/N1pI6IEd81YFU ijwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Hu6qvIBqbRVQXqyiuMzOfbDQzhZ6HIcMRHH52VrCVR4=; b=LG1ttRnqAiepaPjPHQlQOzq98bLD3RPQJ4WPg3TgOedEKHxAtrMINwzSIH5WaHsaT7 FQohbv2+yNchykwxkdyo5b2EFkHuJWt0F/6dJ8I0+lD2zTMwAidF1an+8fS15WrhFy5T 6c0PIxXG6/mobzSjkhiY5BPgUHULk0mCU+N2cOnfXUHW+Yzch36S1j4zwIM7E23zK607 7kiWz03x8y3ustCnHz8u7hDadMa6WVQQaB0Lg31ZmoFwT4ikJzdjSrroit3wFIR77eJH shJ/DSnjvrp004M0UqQGWSt1tHr6kacZdqtnJBqBJmUi6Xm0/JrQt4W8yIlDXJC+fGEa TNbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KBzdM3sm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l63si974322oig.123.2020.03.06.01.37.47; Fri, 06 Mar 2020 01:38:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KBzdM3sm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726162AbgCFJhZ (ORCPT + 99 others); Fri, 6 Mar 2020 04:37:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:42280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725923AbgCFJhZ (ORCPT ); Fri, 6 Mar 2020 04:37:25 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 285B82073D; Fri, 6 Mar 2020 09:37:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583487443; bh=IyUEI189KLN7NzOaIC0uGsky+Dq/9mgX0pL869AYwTM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KBzdM3smU80fwbieeRIomBESOd0DAz9uNN+Igc9aRMBcF/aZLhWV5tX27iDxdrekL bIAwhkwRSbudL4mBN5282Sl4Q1//0tti6yNvgzVzwSHEg3FKbFuobj7vzH0Wuh7piN zBZFBkRXduhi6m4lDqWCWuM3bQ1dmvPkue2723wI= Date: Fri, 6 Mar 2020 10:37:20 +0100 From: Greg KH To: Joe Perches Cc: Daniel Xu , cgroups@vger.kernel.org, tj@kernel.org, lizefan@huawei.com, hannes@cmpxchg.org, shakeelb@google.com, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH v2 1/4] kernfs: kvmalloc xattr value instead of kmalloc Message-ID: <20200306093720.GA3630348@kroah.com> References: <20200305211632.15369-1-dxu@dxuuu.xyz> <20200305211632.15369-2-dxu@dxuuu.xyz> <58c6e6dafabea52e5b030d18b83c13e4f43ab8e3.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <58c6e6dafabea52e5b030d18b83c13e4f43ab8e3.camel@perches.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 06, 2020 at 12:49:51AM -0800, Joe Perches wrote: > On Thu, 2020-03-05 at 13:16 -0800, Daniel Xu wrote: > > It's not really necessary to have contiguous physical memory for xattr > > values. We no longer need to worry about higher order allocations > > failing with kvmalloc, especially because the xattr size limit is at > > 64K. > > So why use vmalloc memory at all? > > > diff --git a/fs/xattr.c b/fs/xattr.c > '] > > @@ -817,7 +817,7 @@ struct simple_xattr *simple_xattr_alloc(const void *value, size_t size) > > if (len < sizeof(*new_xattr)) > > return NULL; > > > > - new_xattr = kmalloc(len, GFP_KERNEL); > > + new_xattr = kvmalloc(len, GFP_KERNEL); > > Why is this sensible? See the thread on v1 > vmalloc memory is a much more limited resource. Large chunks of "len" is much more limited :) thanks, greg k-h