Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp550860rdb; Thu, 1 Feb 2024 17:25:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IGuy5+RUCIdr9tE2kKS8wYoUIMo1H7I2vwgMr8Gfdm88POhbTQVjE+Lb2/NFp3ccQf3QZA6 X-Received: by 2002:a17:906:5399:b0:a36:fc29:2fe2 with SMTP id g25-20020a170906539900b00a36fc292fe2mr395351ejo.0.1706837103678; Thu, 01 Feb 2024 17:25:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706837103; cv=pass; d=google.com; s=arc-20160816; b=Hxk0KZMbMqePX/LLj69sLQiepdnMCfyRUu6i6jvBt7GpGP9hLePwEVt1x/GvUP/QBc sQc+ziqY1oERlPGVUoBmw9WCa5LqoNT8E4LpIgwO72gciSEHgvf/M2ElmDezHuR/zNDE Az7up0GUKTP4QO1MszihVYEgwZHgcMVzSrSVJshoC5iAocWkm2XMGhZKPq2gjDg7cYUs U1jRvlnTTS4oyZ2Mu5ChhfX5IOcpRY7felAI+efRWl/+C8Y/7yeiNZNBFB1yIUIFcMeU cSL1BwWCooy1yj8ZSZjO2u8MqNPfNkqXl0ksLKdNypwOz5Crn1B3eo0OZdnBJdPxKolH KmTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=deTcPudQb1LLYDVYJumshzY+T34o+9j3YfiZCpY3Leg=; fh=CYdxuqWZqk7jCikKWkta/9LKEM607yzEHG4R1DKcWOk=; b=d/4Lnd71iw+CVTuF1IMzq+1eGMw4GBbpdNjqCcAm1haMy6ccvRVPKOTVqaiGpiynaw cAVUtdHiQmRVKXI2AgVvlfXULlv3j1IIYtV2yOLfmal+npYibmBDVk1jVLpgkkYBUx92 ffnkG/Q8zBQd2TMBsk9WkD8JjiKVl7lhV0G8Q9+HZkws+Jvmd/AopL4bpQSQfaR0Uazv iqvw2XexLxl2vR34u9IglVYLXnvs2Cc/1xQoZQx6h2FPWGRJASvtPBx60L5lJONl7njD xxVRd3go3HoksX1FRB5H7zhcBKgfazKWic/9pWbTwV/w/SYxLIV4zS+LZFewqcjqFFwe jSyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=DiNtg3h9; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-49059-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49059-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCVlEyOY7yBSTfFJ9h4BlId102O+VNR7Wfz12f20r/vglANnvx41iOewfdU7BkBOAG6NLhrGsMeYMifzNXsfddI5jBSztwRP0CVFByRGhg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id d18-20020a1709067f1200b00a2dd05df9d5si345510ejr.437.2024.02.01.17.25.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 17:25:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49059-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=DiNtg3h9; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-49059-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49059-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6E0C11F266D3 for ; Fri, 2 Feb 2024 01:25:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4CD2C8EA; Fri, 2 Feb 2024 01:24:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="DiNtg3h9" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8B33C2CE; Fri, 2 Feb 2024 01:24:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706837092; cv=none; b=G/i9ZVgEBmT0LTOEmaC4HIAjhPhkOhE5IZwP2jKLoLdicTWpPzaqcWEQ/7HuiB5ufFSrQw5Nz0oOXnjyaPkRB8A8kws8+1uO5YQeKqD2aB58atLYgqk2TZME0UqNe21wOyCYDZVT9n/hnbOTQhu5lvT8f6DbWLOpxj1HyHXwumk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706837092; c=relaxed/simple; bh=vGXj/mbBHExZ0hyGaeZlChtEqUkXjfoLMRZCEAZOoIY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eDkMRUy6IW/CiKNT4wOPES+CdeNRmq9n/PVkyCluyAaG4Kpp6sUfG3XImNKzzOdiPhzDZBvph8v0P/hYaE6iCBEPler/faY0NELwHh0nBCoVF0drM4iA0n9FVdgRnSzH80ym6QMHIfyBHcqI+cEgq+3PwK0KZrOlEKpXxtBBMKE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=DiNtg3h9; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=deTcPudQb1LLYDVYJumshzY+T34o+9j3YfiZCpY3Leg=; b=DiNtg3h9mNpuI6tOVecjeqd9z1 HYp1EqOP362+2uhN1l080ShEjx1f3xO2fa+xUkANqbMKY3uXPiuZvFIEobsVsf0I688u6RF0EGU/g fi64gMCgkNNObs1fl1iPr2wPGYX1M4R4LaSP9hctzURq+ARzTxm9Sy4ZbpcoFyILZ/J8Dz8RYhhsb 8vXcpah+h3icso4g5vQ/17kTDpgMagYM9ZmFTAF5YbiNBotxDGgj7Y9VV3SNdIPWTZDdOgkdkXUyQ 2VbhG5n4avx4tcxfaPJmMLcGoi23kj56iKSwZrPvUqCmfzE3VLdjpyI8UTO/1+AYkQpES4N6LtrJh 4rwgEpSA==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rViIN-0000000HKmL-4244; Fri, 02 Feb 2024 01:24:44 +0000 Date: Fri, 2 Feb 2024 01:24:43 +0000 From: Matthew Wilcox To: Douglas Anderson Cc: Alexander Viro , Christian Brauner , Eric Biederman , Jan Kara , Kees Cook , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] regset: use vmalloc() for regset_get_alloc() Message-ID: References: <20240201171159.1.Id9ad163b60d21c9e56c2d686b0cc9083a8ba7924@changeid> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240201171159.1.Id9ad163b60d21c9e56c2d686b0cc9083a8ba7924@changeid> On Thu, Feb 01, 2024 at 05:12:03PM -0800, Douglas Anderson wrote: > While browsing through ChromeOS crash reports, I found one with an > allocation failure that looked like this: > > chrome: page allocation failure: order:7, > mode:0x40dc0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO), > nodemask=(null),cpuset=urgent,mems_allowed=0 That does seem bad ... > @@ -16,14 +17,14 @@ static int __regset_get(struct task_struct *target, > if (size > regset->n * regset->size) > size = regset->n * regset->size; > if (!p) { > - to_free = p = kzalloc(size, GFP_KERNEL); > + to_free = p = vmalloc(size); It's my impression that sometimes this size might be relatively small? Perhaps we should make this kvmalloc so that we can satisfy it from the slab allocator if it is small? Also, I assume that we don't rely on this memory being physically contiguous; we don't, for example, do I/O on it?