Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp66609rdb; Wed, 20 Dec 2023 06:30:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCgzQKCb4Y3f1yK3F0TTvsztb5s59bOT/NN1JlnblbxxLw8XJQgMHwR/1Fmpa6Foban255 X-Received: by 2002:a50:9553:0:b0:553:98f0:a495 with SMTP id v19-20020a509553000000b0055398f0a495mr2708816eda.3.1703082637611; Wed, 20 Dec 2023 06:30:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703082637; cv=none; d=google.com; s=arc-20160816; b=lcHIElkoZzoUXXH7KWMxgpq8v1YDNchi5rxXYrYTFWgOW8EKRNE8hq9RBfhO3Xumv+ nh2Ok7gR45pHx80yygNYhAe+Q/nWYXGSXt9UC1KjSCrvgHvXSP8OfeXYu8Atn4BshUSf BJVehmc+8n0x/eBsMT/DlxVtvecRMRnu6CMYk7iaKC+tq6NqpaubGNDUIUHTCwoaTkqs 155bQq7ufsbKlrO3NUNerRLWVnu0F0Tulb79gCtIxOUVqzeDh0ALsnCrcZHHnyuiUU2L nThVTPA69zOGaVGWoPG/jw6iqdMbNfm99Z+Jmi0KkzWAeDtE2wp0dJ4w7EgN+ZC4pUKH t3CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=sGysG6ojdmrXVnHlpUnSAv2mwZYzeAa/QMg1GsEL1sw=; fh=BiTih3HBn05OJvpBeKJCJhFgvirybBPBq65CdTV6sMo=; b=fqQHoBnzwM2961RA49wxeAFavAKSAx4P0t29VrTY461Gut/QdmfpemhsMzAM3BIxOC J/Dnfi6/n0UVKoj2wEScmCMQgW6w2As1gCbNgg04am7TNobW9px+LpZAZgvTBjVahEJB t7c9VyjU84rKn3LrDV6tzA8n7+cGtqbkKukEOpTxRFD5qLHaBazXDrG+7XWbUdDPbssb 0lAu27v9MYSavISyZKvojxUZ0cIg03KYEt9gxmqKguMd0c4x072JTCM2Lx7NBNNCcXYd 1DUhxt+mRvDO13iWccd0i0F0PueH3vtG5IETSCO5/v3nh+tme4I9swzgvYzzvE3Golw4 2ohA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-7062-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7062-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id de1-20020a056402308100b0055376240f18si2120004edb.92.2023.12.20.06.30.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 06:30:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7062-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; spf=pass (google.com: domain of linux-kernel+bounces-7062-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7062-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 5949C1F22B25 for ; Wed, 20 Dec 2023 14:30:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2575A39841; Wed, 20 Dec 2023 14:30:31 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) (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 7CCB138FAB; Wed, 20 Dec 2023 14:30:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=kernel.org X-IronPort-AV: E=McAfee;i="6600,9927,10930"; a="380811906" X-IronPort-AV: E=Sophos;i="6.04,291,1695711600"; d="scan'208";a="380811906" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2023 06:30:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10930"; a="919992164" X-IronPort-AV: E=Sophos;i="6.04,291,1695711600"; d="scan'208";a="919992164" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2023 06:30:27 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rFxaa-00000007YhR-3EWU; Wed, 20 Dec 2023 16:30:24 +0200 Date: Wed, 20 Dec 2023 16:30:24 +0200 From: Andy Shevchenko To: Kent Gibson Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, brgl@bgdev.pl, linus.walleij@linaro.org Subject: Re: [PATCH 2/4] gpiolib: cdev: allocate linereq using kvzalloc() Message-ID: References: <20231220015106.16732-1-warthog618@gmail.com> <20231220015106.16732-3-warthog618@gmail.com> 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: <20231220015106.16732-3-warthog618@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Wed, Dec 20, 2023 at 09:51:04AM +0800, Kent Gibson wrote: > The size of struct linereq may exceed a page, so allocate space for > it using kvzalloc() instead of kzalloc(). It might be this needs a bit of elaboration. The kmalloc() tries to allocate a contiguous (in physical address space) chunk of memory and with fragmented memory it might be not possible. So the above issue might (rarely) happen. In most cases the call to kmalloc() will succeed. -- With Best Regards, Andy Shevchenko