Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp934029imm; Fri, 3 Aug 2018 14:24:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeEbmFwf92kIFJEe5A4TmJO3SdnlTgQkq96xoll8L9bt1Q0L7TfIqIfqtyuyQfZ6kEfRmI2 X-Received: by 2002:a17:902:e005:: with SMTP id ca5-v6mr5060265plb.224.1533331453136; Fri, 03 Aug 2018 14:24:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533331453; cv=none; d=google.com; s=arc-20160816; b=FUrXVBR9PepjjFwCF6D0kT560ge690Fqua7uKZPwwZ3WdSiPgyeetDmf418o3VLD7l siMofYdIjIJ7V2EOyJnVfLHdAibhHUQabcrJ7Y2KHBRQgJqK2xUS0Fjefi0G9g4pEs2i sLTIwa7cLuu3+CLFAdStWrXzDA5HlshRkupVj0J4HEzq30m6EELh6suHJBvf9Sog27jP yvyMCdFuo99K5VNW1fgetn/EvyxvIro9/952iB1TscvYqQRYWJIfrPM3PKqacswBnHQk PXigBqeBxr9lrsRZeucrKSDZdxbHrDYLLsv8zSSkgAt0EyoMffBsye0QSrV0aZODVgtq aVQw== 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:dkim-signature:arc-authentication-results; bh=Sa9nRDr+KZmYiB4Q4AxYE2odyaq1ujZfd7MiDXmrgzo=; b=0O/zk1srHagLQWorOP1vhP3UzmX+ia0fPnYjne2MH4LKqS5B8yCv2wVSyWvHRTMpbf YN65UwgxPmuJbHiEvaxam4lym0DaIYxVa0OzpgS1/Oty5nw9nXyyBuDBI7BnG924YBDO b1ThkfgD2+n2+bfFy4l33A/bnKBfUNJI8xDG5dkkKzuffpDklSheQRDROGqG+pCT4i9a 63iTSHzUPgzeV/xsJp9QvY3HfQIwyZjhj9ZNFDQKV7/bSvxrIEaRIFMKvhOlPrRpXLSr SWeZOdwQQCsP3QDr/B0Whpp974gUiyH5YM0HAcsMpgQ9R4F3m53Y0L2rMXYgg/6MDK/Z M4LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=DGY6DCr4; 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 l33-v6si5918467pgm.350.2018.08.03.14.23.58; Fri, 03 Aug 2018 14:24:13 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=DGY6DCr4; 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 S1732034AbeHCXVA (ORCPT + 99 others); Fri, 3 Aug 2018 19:21:00 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:39808 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729828AbeHCXU7 (ORCPT ); Fri, 3 Aug 2018 19:20:59 -0400 Received: by mail-pl0-f67.google.com with SMTP id m1-v6so3081626plt.6 for ; Fri, 03 Aug 2018 14:22:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Sa9nRDr+KZmYiB4Q4AxYE2odyaq1ujZfd7MiDXmrgzo=; b=DGY6DCr4/XZPHyFEuVH1JPs69RGFD2wZVnY3uVZmgkcNOwm2w0S9f9AkC9hjwJiKMY gP8ASLh3ij6NauvFeQB9EKvsFi1t3Vdn5CfB8XghCoUqb/M3sRpdZkkYnw9xYuAAyy94 OEIzmC9/SO5XGXPXpcxlrSc/p+/Bu/wfs0VMnRftxbcVOJ9hn3hV9/EpiE19M7R5xnHk ziBZXHRbioOBEWcuFiNGoZXchBQS6Jwi/Q6IdC2rmI07aS6tORzxFy58OeRCIFCw7n9K X6M8UAKSpxFD/AAHTIHcBbwoKX04yZOyp0zy7dIDSbTGql4v83od/gQlvP4bqHifuK+h sUkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Sa9nRDr+KZmYiB4Q4AxYE2odyaq1ujZfd7MiDXmrgzo=; b=ScWvZD8G/gx5g5QQO6lHyOiiLOZGWADV3LLyxB4WKAf/pwqmzuOYQmmAWuDGqMvdSs TOYUGIWCQJHQTvl8BMYgd+2/oc9JTwSBXEwwEeZyGYFzHM/eMZA1295PLbD/VCr7todM paDfCXD7D8kdDrmeFcF6h9FBkWZzLqFuGiM+6wf9kwQEdzj56qVUDrJLQLsrLfQ+Uv8b tO/zlTmctSHH7lXdHriMwifAtOrzlFgC/D0dQm2qMlw1oCfg7bmflUsfDFi7QIh/K3tA dRDvdxo8tRayh5EoO+FATEsXO3B2v3L14sgMAFtz28k/hPNopsOysLxwPLcvgD3aWvqr 2gdw== X-Gm-Message-State: AOUpUlE50D3XN6YnYH0hDj+lBbCJ4hXxGmQTlsRP/FCiZ0RbteQ1nRT3 ghWVqyeBPFmxfNDL1Cd6XtM= X-Received: by 2002:a17:902:6b:: with SMTP id 98-v6mr4979359pla.68.1533331379454; Fri, 03 Aug 2018 14:22:59 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id y3-v6sm13959449pfi.24.2018.08.03.14.22.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Aug 2018 14:22:58 -0700 (PDT) Date: Fri, 3 Aug 2018 14:22:57 -0700 From: Guenter Roeck To: Matthew Wilcox Cc: Christopher Lameter , linux-mm@kvack.org, Matthew Wilcox , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-kernel@vger.kernel.org, Jan Kara , Jeff Layton , Mel Gorman Subject: Re: [PATCH v3 2/2] slab: __GFP_ZERO is incompatible with a constructor Message-ID: <20180803212257.GA5922@roeck-us.net> References: <20180411060320.14458-1-willy@infradead.org> <20180411060320.14458-3-willy@infradead.org> <20180411192448.GD22494@bombadil.infradead.org> <20180411235652.GA28279@bombadil.infradead.org> <20180412142718.GA20398@bombadil.infradead.org> <20180412191322.GA21205@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180412191322.GA21205@bombadil.infradead.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Apr 12, 2018 at 12:13:22PM -0700, Matthew Wilcox wrote: > From: Matthew Wilcox > > __GFP_ZERO requests that the object be initialised to all-zeroes, > while the purpose of a constructor is to initialise an object to a > particular pattern. We cannot do both. Add a warning to catch any > users who mistakenly pass a __GFP_ZERO flag when allocating a slab with > a constructor. > > Fixes: d07dbea46405 ("Slab allocators: support __GFP_ZERO in all allocators") > Signed-off-by: Matthew Wilcox > Acked-by: Johannes Weiner > Acked-by: Vlastimil Babka > Acked-by: Michal Hocko Seen with v4.18-rc7-139-gef46808 and v4.18-rc7-178-g0b5b1f9a78b5 when booting sh4 images in qemu: ata1: PATA max PIO0 mmio cmd 0xb4001000 ctl 0xb400080c irq 107 physmap platform flash device: 02000001 at 00000000 WARNING: CPU: 0 PID: 926 at mm/slab.c:2666 cache_alloc_refill+0x8a/0x594 Modules linked in: CPU: 0 PID: 926 Comm: kworker/u2:2 Not tainted 4.18.0-rc7-00139-gef46808 #1 PC is at cache_alloc_refill+0x8a/0x594 PR is at kmem_cache_alloc+0x72/0xac PC : 8c0b1e06 SP : 8fad5ed8 SR : 400080f0 TEA : c0087fe0 R0 : 00008000 R1 : 006080c0 R2 : 006080c0 R3 : 8c01e110 R4 : 8f801a00 R5 : 00000000 R6 : 00000000 R7 : 00000000 R8 : 0000000c R9 : 006080c0 R10 : 8c48302c R11 : 8fae8e60 R12 : 8f802540 R13 : 8f801a00 R14 : 8c4f22e8 MACH: 00000085 MACL: 00000e00 GBR : 00000000 PR : 8c0b244e Call trace: [<(ptrval)>] arch_local_irq_restore+0x0/0x24 [<(ptrval)>] arch_local_save_flags+0x0/0x8 [<(ptrval)>] kmem_cache_alloc+0x72/0xac [<(ptrval)>] arch_local_irq_restore+0x0/0x24 [<(ptrval)>] mm_init.isra.7+0xb4/0x104 [<(ptrval)>] __do_execve_file+0x1f8/0x5b4 [<(ptrval)>] do_execve+0x16/0x24 [<(ptrval)>] arch_local_irq_restore+0x0/0x24 [<(ptrval)>] call_usermodehelper_exec_async+0xe0/0x124 [<(ptrval)>] ret_from_kernel_thread+0xc/0x14 [<(ptrval)>] schedule_tail+0x0/0x54 [<(ptrval)>] call_usermodehelper_exec_async+0x0/0x124 ---[ end trace 10ff75dd606d4222 ]--- This is not a a new trace; I had missed it because the "cut here" line is missing from the log. qemu command line: qemu-system-sh4 -M r2d -kernel ./arch/sh/boot/zImage \ -initrd rootfs.cpio \ -append 'rdinit=/sbin/init console=ttySC1,115200 noiotrap' \ -serial null -serial stdio -net nic,model=rtl8139 \ -net user -nographic -monitor null Guenter