Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp732704imu; Thu, 22 Nov 2018 04:38:25 -0800 (PST) X-Google-Smtp-Source: AJdET5dU0JnoOU8gTCc6pV/eEOU1oBm02R+Qml/5EVqZI0RRSmkHqROVXRT+QMcXKma2Iuhpp5yg X-Received: by 2002:a62:7a8b:: with SMTP id v133mr11499275pfc.159.1542890305203; Thu, 22 Nov 2018 04:38:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542890305; cv=none; d=google.com; s=arc-20160816; b=lcy4bj033KxfM0mrxTxzVXZsUi4zUmqa9LAiVJE4GFdKlPcAboIgJ5fOrPrI0BCoAt ssIIbGhppIL5m0bAd2ZAN9HPYAlwKIaF6yXG4h269BmwX+VohxDrq/1BZ/KRvvYbZ9px H6nGFwlni9sybTh1bXSSLueMwaaG7aRjZsTnyCLxIbDmdp4afky1jkoGxpqSVAxn5ZPe Ln0fuP6PfbWwWWtN2JvJatw4E5VEj5IlMFKvsxW6pCAMnVlV31wY9mBadDIDgrFRTFsW AFcy7pqNIlu9jpFID5GcEubdMTtPTZAAdArqF+C5DbSqQNFdAD1JSrVzef2tAyG7FBkg O7UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=mgzqfiRQBoL9QPyLrNO7xQ21AD736G0rhe/S0Lccysk=; b=SnWVFxFGVs3mksgHJJMvetI/WKUm2UwMRG/1ipczCoCBblAkQEKzf6AG+saH0dxWMl p2KQX4UkczaKV+l0l8vqNbXs4O55t7dyT7p3nCUpFuGbIpFZqvLgTNGBGj/A+RZo51z4 BPq1bybmBEVWBVEvBbE/sI2FDW6iSBfxqeDrDvHhGX5sA2+vB2Z+F2XmX7aHyJ16+bsh MgtlSLqQh0rAvnnTz6uGV+emCaTjqXdXIFDlA2uclDObelO4haKB8k7Y2K+E+awIJqRC rUaRf0iXYu7XvbXMm+jZ7i2SXnuba1h6LqUQzHI6V4rQX11TmJqF4AombhSm8brl288H sDnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NZpfqCby; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s123-v6si54581584pfb.178.2018.11.22.04.38.09; Thu, 22 Nov 2018 04:38:25 -0800 (PST) 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; dkim=pass header.i=@chromium.org header.s=google header.b=NZpfqCby; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391104AbeKVL3s (ORCPT + 99 others); Thu, 22 Nov 2018 06:29:48 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:45454 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730678AbeKVL3s (ORCPT ); Thu, 22 Nov 2018 06:29:48 -0500 Received: by mail-pl1-f194.google.com with SMTP id a14so7830018plm.12 for ; Wed, 21 Nov 2018 16:52:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mgzqfiRQBoL9QPyLrNO7xQ21AD736G0rhe/S0Lccysk=; b=NZpfqCbyrGduQBAcUcjZb376y1/oqbGwYLy0kJWTPgJ/eVmMEnaRaJvsBMgg0yRaSn oxIJvPrvLwuxNvEuuQ1C/baLQ4k5/u5JvSorCMIh5fdX7GqB2RWRdsueRBf/zzAjA5i2 J7rNN3liQZJdwhqry0SI+3VDS5m09DM2k6rJQ= 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=mgzqfiRQBoL9QPyLrNO7xQ21AD736G0rhe/S0Lccysk=; b=ew2j7UM17J5PAv6vtTjQYP7CU69DEOD5T8GwJUZMubnG0/mkHn0ST/qg8xK90ehJWh NUxRen73UUGYyhQwo4xZ5TvM14wKKXBBaNhuaXPHmkbp4kmbfOPw37IyOOq6xc8P4Ffw Utyqjkr7OS+wVHTwUu3FAf1z/HjsJCXNFWjorf55oEvZBT3yNA9YZE36MMBrAsu/D4Au eXS+/8sPiT8RJRAQV8lVyM/+mEGIxWoO3Py5kNyz8IgBZ+5Yn+XKOFdA0MOJegpnFvs2 tBSibpnm+9OxlWC3KyP2Bx493wMlKZdPtKH9PFTxt0CigRgOHyaHb9YbNv9y52MqzDng jYjQ== X-Gm-Message-State: AA+aEWY02fnOKmutBpgq91ZGUDPlWzgEXU5vWvbS7/dAnHdTU+kmbbiL RLhvgRc/SfG/b3pxEks6V6SbMr8l+kxoXxhyDSWTkQ== X-Received: by 2002:a63:6645:: with SMTP id a66mr7851490pgc.390.1542847977589; Wed, 21 Nov 2018 16:52:57 -0800 (PST) MIME-Version: 1.0 References: <20181111090341.120786-1-drinkcat@chromium.org> <20181111090341.120786-3-drinkcat@chromium.org> <01000167378bf31a-a639b46c-4d1d-43de-9bed-9cdd9c07fa94-000000@email.amazonses.com> In-Reply-To: <01000167378bf31a-a639b46c-4d1d-43de-9bed-9cdd9c07fa94-000000@email.amazonses.com> From: Nicolas Boichat Date: Thu, 22 Nov 2018 08:52:46 +0800 Message-ID: Subject: Re: [PATCH v2 2/3] mm: Add support for SLAB_CACHE_DMA32 To: Christoph Lameter Cc: Robin Murphy , Will Deacon , Joerg Roedel , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Michal Hocko , Mel Gorman , Levin Alexander , Huaisheng Ye , Mike Rapoport , linux-arm Mailing List , iommu@lists.linux-foundation.org, lkml , linux-mm@kvack.org, Yong Wu , Matthias Brugger , Tomasz Figa , yingjoe.chen@mediatek.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 22, 2018 at 2:32 AM Christopher Lameter wrote: > > On Sun, 11 Nov 2018, Nicolas Boichat wrote: > > > SLAB_CACHE_DMA32 is only available after explicit kmem_cache_create calls, > > no default cache is created for kmalloc. Add a test in check_slab_flags > > for this. > > This does not define the dma32 kmalloc array. Is that intentional? Yes that's intentional, AFAICT there is no user, so there is no point creating the cache. (okay, I could find one, but it's probably broken: git grep GFP_DMA32 | grep k[a-z]*alloc drivers/media/platform/vivid/vivid-osd.c: dev->video_vbase = kzalloc(dev->video_buffer_size, GFP_KERNEL | GFP_DMA32); ). > In that > case you need to fail any request for GFP_DMA32 coming in via kmalloc. Well, we do check for these in check_slab_flags (aka GFP_SLAB_BUG_MASK before patch 1/3 of this series), so, with or without this patch, calls with GFP_DMA32 will end up failing in check_slab_flags.