From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755455AbeEaPCG (ORCPT ); Thu, 31 May 2018 11:02:06 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:39470 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755254AbeEaPCD (ORCPT ); Thu, 31 May 2018 11:02:03 -0400 X-Google-Smtp-Source: ADUXVKLPhnZFdSakSeRYVCcFZY+l+x67wqRhmIgLInobmLN0l4K94urZR3XcJsnWu81eGh6Y8KAI/HGadW6Y54htdyI= MIME-Version: 1.0 References: <20180524211135.27760-1-dave@stgolabs.net> <20180524211135.27760-4-dave@stgolabs.net> <20180529144317.GA20910@dhcp22.suse.cz> <20180529145106.GV27180@dhcp22.suse.cz> <20180530074216.GZ27180@dhcp22.suse.cz> In-Reply-To: <20180530074216.GZ27180@dhcp22.suse.cz> From: Linus Torvalds Date: Thu, 31 May 2018 10:01:51 -0500 Message-ID: Subject: Re: [PATCH 3/6] lib/bucket_locks: use kvmalloc_array() To: Michal Hocko Cc: Davidlohr Bueso , Andrew Morton , Thomas Graf , Herbert Xu , Manfred Spraul , guillaume.knispel@supersonicimagine.com, Linux API , Linux Kernel Mailing List , Davidlohr Bueso Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 30, 2018 at 2:42 AM Michal Hocko wrote: > > That being sad, if you believe that silently fixing up a code like that > is a good idea we can do the following of course: Ack. Except for: > Linus argues that this just motivates people to do even > more hacks like > if (gfp == GFP_KERNEL) > kvmalloc > else > kmalloc > > I haven't seen this happening but it is true that we can grow those in > future. This whole discussion came from the fact that YES, THIS IS ACTUALLY HAPPENING. See lib/bucket_locks.c - it just uses gfpflags_allow_blocking() instead of explicitly checking for GFP_KERNEL (probably because the only two cases it actually deals with is GFP_ATOMIC and GFP_KERNEL). Linus