Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp466426imm; Thu, 21 Jun 2018 23:06:47 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJZ5NENj6TB8O7NJq+BEq9rYOUItDNBRqFLEszZCybU/w2ODsrEcm3GdBa7RZpX+E1dzp0p X-Received: by 2002:a65:62cd:: with SMTP id m13-v6mr201132pgv.207.1529647607704; Thu, 21 Jun 2018 23:06:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529647607; cv=none; d=google.com; s=arc-20160816; b=LiPWGuTZGlJVLaHhYMUkXioXLT699FIMsPDwmiqwWxhjKQFOqvYmHggKricpRTx6PO S6UQNB5XAXnM+6URDa3KS7Yz48Zub3fN8GioHrRGMPi7teN5kTG+IzNJ/1AYWgnR51+/ eq2MJ9q45onJAd4PU5T8iT7zrEhoEXyAFsOPIQRRTkfvuFC6LP415VNZFwHDCeRSUB6j 6o89yfPMGq/q+aWcUcA2Dej4g0jsmGf4umbPlaNCnvJirW+UgGmfTlKP00PkcqViCmEz q8F8NPOGpqGmMeao5zOZYfAkwdbVTNrbJDFWVQvywWDkeCq7oUV87LFnN43pkbF8rXEg RBgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:references :in-reply-to:subject:cc:date:to:from:arc-authentication-results; bh=k1smHSf+BpHc7cuObyMDkpa+danaURnMQUgMALV+zOs=; b=eoHMwJ1QL98yqS/i3taQmVd5sPd335Ktkm/4BMNbJX0yH39UwnmQZXqSDEbXDXIKwV XR/HBY++KlSro+aIXfST2PcJaMKccpnLR9rBB/+736AUpg3gxIA0w+JbicxOBTpLgk+D a1UBlCoIcFl/Cl7Wi+yO0StIVPSSMtdLme6qYdoBNetgi+myAMz3WsHnxCA31Iebpqet 4CZRuDxyVatIqRQjmRrlRBQxyvdTJ00SkssA5rD4Sayg/ufD02Sw3/EOnItnimcDZK0t MzAjdTqSpSsGhtdeKbjJNLlH5b5XiBuDmho8I4icxWzOpKvrrraojjmP5QoKb+5NoBnb 5DMQ== ARC-Authentication-Results: i=1; mx.google.com; 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 e76-v6si7000724pfj.250.2018.06.21.23.06.33; Thu, 21 Jun 2018 23:06:47 -0700 (PDT) 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; 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 S1751228AbeFVGEo (ORCPT + 99 others); Fri, 22 Jun 2018 02:04:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:41620 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750899AbeFVGEn (ORCPT ); Fri, 22 Jun 2018 02:04:43 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8A9A8AC06; Fri, 22 Jun 2018 06:04:40 +0000 (UTC) From: NeilBrown To: Davidlohr Bueso , akpm@linux-foundation.org, torvalds@linux-foundation.org Date: Fri, 22 Jun 2018 16:04:29 +1000 Cc: tgraf@suug.ch, herbert@gondor.apana.org.au, manfred@colorfullife.com, mhocko@kernel.org, guillaume.knispel@supersonicimagine.com, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, dave@stgolabs.net, Davidlohr Bueso Subject: Re: [PATCH 1/4] lib/rhashtable: simplify bucket_table_alloc() In-Reply-To: <20180621212825.3059-2-dave@stgolabs.net> References: <20180621212825.3059-1-dave@stgolabs.net> <20180621212825.3059-2-dave@stgolabs.net> Message-ID: <87sh5fbbma.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu, Jun 21 2018, Davidlohr Bueso wrote: > As of ce91f6ee5 (mm: kvmalloc does not fallback to vmalloc for incompatib= le gfp flag), > we can simplify the caller and trust kvzalloc() to just do the right thin= g. Hi, it isn't clear to me that this is true. With this change we lose __GFP_NOWARN and __GFP_NORETRY. I doubt the NORETRY is particularly important as this is if it isn't GFP_KERNEL, then it is GFP_ATOMIC which doesn't retry anyway. However I cannot see why this patch won't result in warnings when the kzalloc() fails. What am I missing? Thanks, NeilBrown > > Signed-off-by: Davidlohr Bueso > --- > lib/rhashtable.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/lib/rhashtable.c b/lib/rhashtable.c > index 9427b5766134..26c9cd8a985a 100644 > --- a/lib/rhashtable.c > +++ b/lib/rhashtable.c > @@ -175,10 +175,7 @@ static struct bucket_table *bucket_table_alloc(struc= t rhashtable *ht, > int i; >=20=20 > size =3D sizeof(*tbl) + nbuckets * sizeof(tbl->buckets[0]); > - if (gfp !=3D GFP_KERNEL) > - tbl =3D kzalloc(size, gfp | __GFP_NOWARN | __GFP_NORETRY); > - else > - tbl =3D kvzalloc(size, gfp); > + tbl =3D kvzalloc(size, gfp); >=20=20 > size =3D nbuckets; >=20=20 > --=20 > 2.16.4 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAlsskW4ACgkQOeye3VZi gbn7zg//fU8eWByU5G8DUvjNQb8M8sQr9j9WeuCp+qdY5tY+x/XvrMjDS/VV/bTL oz4Dn5xOTMRTWwIemTbZjmtFnTrWlcq9+41RfFt6q5olObhRz8YP61Wh8PJ8Fw/a L8PobNEZEtOjyM6+2tzyQfVDLpE2DExP5LGHrFsyO8DW3H5ySr3PsXzPIgQ0Gr4l NYaBZu3RJ5s6jyH4qqfWvc/6Uhsb0gDYbGZsFqMzIY7Tus6zekWOEzDhIWTa7lDd p7m4qNbIob8Qe9DyeCtMYOzNsvghNnGo1I3tX/2776kRGyC569Rh8/UcVBGih6No egx76xidljBL3kCUimOWDCwC/twrZCu2e7WMrib/bhjXnyak4UnZdMnYkgZdEevF dehDM7q+8Er8Vk9aGGZcVzWWcVae9F3anINuE/5ubgciKqhgazovTSU2HcfxZskd kyBoxNII+5raSG1X+pur8obZ62hts1pvtaxTvfTcqULfdH3E+425vzSGLLi/DB7M n79PvrxrbPGJghqadPUuhZU9PwU6YnJYpjvUxRFwb5/1YmQhKpmK3/3levhiPGRb fCg41lm/NpuCgqgxxosFiuc6kA8JCPuAe9lrrqQqI97xOnW1ulxZYvTTgOHzgVn2 wzvIWVst23cvTqCDlWPcFMWxG6cmG1KpW0VgNxn9AtsmiwS7BM4= =Juyg -----END PGP SIGNATURE----- --=-=-=--