From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4E8DC2D0A3 for ; Wed, 4 Nov 2020 08:22:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E8FB322203 for ; Wed, 4 Nov 2020 08:22:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="0kZJ8Rb9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8FB322203 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BF14F894EA; Wed, 4 Nov 2020 08:22:15 +0000 (UTC) Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3D6216E8A8 for ; Tue, 3 Nov 2020 10:12:14 +0000 (UTC) Received: by mail-il1-x142.google.com with SMTP id g15so869832ilc.9 for ; Tue, 03 Nov 2020 02:12:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=b9Ktpm35fisVuHEhjhohgaqyboE8BmrrMoCITk9vnK8=; b=0kZJ8Rb9+0/H3MVDUevyCTWAc1pKYDKmZzYacQKCMmC/UQ66qmBgifq30qeC2iVztI ATPY1knKGSXDzJ6+Nm3tm3Ffn81WkUy/sBCmPfD94FibScrq8/Ui+9TUYldHJ7pcnk1t gx+nhhl2zwwSRNNGE6X3g+mK8ICIfWN15TzWFBAm2Ac+Fnp/Nc7mvMvQxol3TgeHLuHe fB2HlcDfVoQUKXEDUTDlyUi1MwQ1IJbHWYhRPhxFdctoJ/ps1THqNVawMwUkgd/uHgQv AYOBJizY9XV1L84dWspkXE7W+jTkhJPV/Ws9WaUAfWMNJujPYu+ExPkpZXByTNBy8wKU VaOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b9Ktpm35fisVuHEhjhohgaqyboE8BmrrMoCITk9vnK8=; b=OezqJTtjxHePnXey7TlURyacHqNpvEPxw28y/E1ZSO/1Aofm5pzO1f++jnrgGucpUU CS/HLMealdVmK/a+QQ+XIaJKaMTLRsIRtlEFiEeBLCRAT1KEwr9zBcQJs0Ue9KkEirFb WYSMcMoHWnhDf4d55JUMJ9PmUupDbbAjOwtOX+FM/1/d4YzY6pHv/VUcLVeTO6afn2nc ppduKox6Nc8bpaB43X7a679FFTiumSmXGcHC7buh+rLSaKemjuqTfKNtPLWEYtwI7FaS cYPxaANnGMb85Q9oxLYk4iD6+9RYmHnwe2l/W8tDkGPNF6szInNhsDAhQI00m7ptFZtt 9xbw== X-Gm-Message-State: AOAM531/0yH7x6CjRj675zf1YbTfOsrx0X3KrgIXEf88coKFGk5PcyUl ghlnFzpX55pDOJjlObcBcueewLlSOsjyVjpdf6JXmw== X-Google-Smtp-Source: ABdhPJxXaKRnidyqbx6iUG254lVJzvxaSAJ3Y8t7tBOtYCNJcNKDXTe4r/tIo6bcU8qIdoqImm6tntmYdwdU1LT5yRY= X-Received: by 2002:a05:6e02:926:: with SMTP id o6mr14285653ilt.287.1604398333472; Tue, 03 Nov 2020 02:12:13 -0800 (PST) MIME-Version: 1.0 References: <20201102152037.963-1-brgl@bgdev.pl> <21d80265fccfcb5d76851c84d1c2d88e0421ab85.camel@perches.com> In-Reply-To: <21d80265fccfcb5d76851c84d1c2d88e0421ab85.camel@perches.com> From: Bartosz Golaszewski Date: Tue, 3 Nov 2020 11:12:02 +0100 Message-ID: Subject: Re: [PATCH v2 0/8] slab: provide and use krealloc_array() To: Joe Perches X-Mailman-Approved-At: Wed, 04 Nov 2020 08:22:13 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA , kvm@vger.kernel.org, "Michael S . Tsirkin" , David Airlie , Gustavo Padovan , "open list:DRM PANEL DRIVERS" , Jaroslav Kysela , linux-mm@kvack.org, Christoph Lameter , Mauro Carvalho Chehab , Bartosz Golaszewski , Alexander Shishkin , David Rientjes , virtualization@lists.linux-foundation.org, Jason Wang , Linux Media Mailing List , Robert Richter , Thomas Zimmermann , linaro-mm-sig@lists.linaro.org, "open list:GPIO SUBSYSTEM" , Borislav Petkov , Andy Shevchenko , Andrew Morton , linux-edac@vger.kernel.org, Tony Luck , netdev , Takashi Iwai , Linux Kernel Mailing List , Pekka Enberg , James Morse , Joonsoo Kim , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Nov 3, 2020 at 5:14 AM Joe Perches wrote: > > On Mon, 2020-11-02 at 16:20 +0100, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > Andy brought to my attention the fact that users allocating an array of > > equally sized elements should check if the size multiplication doesn't > > overflow. This is why we have helpers like kmalloc_array(). > > > > However we don't have krealloc_array() equivalent and there are many > > users who do their own multiplication when calling krealloc() for arrays. > > > > This series provides krealloc_array() and uses it in a couple places. > > My concern about this is a possible assumption that __GFP_ZERO will > work, and as far as I know, it will not. > Yeah so I had this concern for devm_krealloc() and even sent a patch that extended it to honor __GFP_ZERO before I noticed that regular krealloc() silently ignores __GFP_ZERO. I'm not sure if this is on purpose. Maybe we should either make krealloc() honor __GFP_ZERO or explicitly state in its documentation that it ignores it? This concern isn't really related to this patch as such - it's more of a general krealloc() inconsistency. Bartosz _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel