Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1363583imm; Fri, 1 Jun 2018 22:42:46 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI3qmNklUGP+fPmM99FDppXnGPX6HtbnGUVRQfodxwAZfeeL8F8BfmBO/4f7sygm7XB9Fza X-Received: by 2002:a65:4c87:: with SMTP id m7-v6mr11275280pgt.364.1527918166346; Fri, 01 Jun 2018 22:42:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527918166; cv=none; d=google.com; s=arc-20160816; b=N9RleOyUlj9W7wqUCX3TjYlZcnVhWvVfDa+VdybYrrRmvF4oioT6hOWICSjGFVtAb0 iIfMKejDroeDwwjt46Mq+8/sQwpPc03o5+dCddFny/gP1P8zHokpuudZarXs9USe2AII LitoEgojdnRvpaPQIGf/PoU1FAXiV+/hkNNUZj6uIGKf3fD/Dm02lPn2eAx1RsjGQ1vO MVXXPRS0Pd4qr8qApBJxsBt6M3w6Qd4/g22F9iEW0VYEDolUZRBixgvYnm147KVXT3O+ fjdyIrP0gaP2GPIQ3vxpQ7ec9HvU7ir8B16LWMamDNHUETE0NPsLY5JJeLOIeY8QCtme vOmQ== 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:arc-authentication-results; bh=e38I2h30h08/xE2CeWNinr16ZHzY1S+Gj8pOr08ehF4=; b=G9WK/JiKXGfralpdx5rPrFAg5qQe4rRW6P2ZRtMeKPG0iWwT0M4dKFhFmD6OkYScFv qlHqN7cUk2vxtyX2S18hc/aQF/lZ6UVh23MLkoTVrkUdKmF/BdljYFLpDLTDeQV9C5UQ tdlsrdA/DFpmLCYe6NK1ZZtP7pmahMEcMeiwlspmiLDybU+7JaqWHmFii+l6WEcCAFEW fETrcpgiXazEAidly7u2zYT91qbNOW4ofNfHiM37fRpJOKmBqxL7aJ3YZhAwqCOKxfT1 mR98PJFw0KR6dQ5NLv5JYMW9SxFRjUuBs3nbgzx9NNzqUXppTpET0Hi71bzuNyH1PjSF vDsg== 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 y34-v6si41539162plb.17.2018.06.01.22.42.32; Fri, 01 Jun 2018 22:42:46 -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 S1751364AbeFBFln (ORCPT + 99 others); Sat, 2 Jun 2018 01:41:43 -0400 Received: from mx2.suse.de ([195.135.220.15]:38580 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750750AbeFBFll (ORCPT ); Sat, 2 Jun 2018 01:41:41 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8F00DAF44; Sat, 2 Jun 2018 05:41:39 +0000 (UTC) Date: Fri, 1 Jun 2018 22:41:31 -0700 From: Davidlohr Bueso To: Herbert Xu Cc: akpm@linux-foundation.org, torvalds@linux-foundation.org, tgraf@suug.ch, manfred@colorfullife.com, mhocko@kernel.org, guillaume.knispel@supersonicimagine.com, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH 2/5] lib/rhashtable: guarantee initial hashtable allocation Message-ID: <20180602054131.ta7ligrfwbgvemfv@linux-r8p5> References: <20180601160125.30031-1-dave@stgolabs.net> <20180601160125.30031-3-dave@stgolabs.net> <20180602044150.xpazuhpxbwt37xmu@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20180602044150.xpazuhpxbwt37xmu@gondor.apana.org.au> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 02 Jun 2018, Herbert Xu wrote: >> tbl = bucket_table_alloc(ht, size, GFP_KERNEL); >> - if (tbl == NULL) >> - return -ENOMEM; >> + if (unlikely(tbl == NULL)) { >> + size = min_t(u16, ht->p.min_size, HASH_MIN_SIZE); > >You mean max_t? Not really. I considered some of the users to set quite a large min_size (such as 1024 buckets). The min() makes sense to me in that it's the smallest possible value. If memory later becomes available and the hashtable is resized to a more appropriate value, couldn't any issues regarding collisions not be dealt with organically? And we've agreed that allocating a tiny table is the least of our problems. Thanks, Davidlohr