Received: by 10.223.185.116 with SMTP id b49csp580717wrg; Wed, 14 Feb 2018 03:52:14 -0800 (PST) X-Google-Smtp-Source: AH8x224i38wIQp7aM8XPqtQtYiVhIQAU9+qkdylOlk5xR3YL1YS9+mGDqXVVayo/d40J8S6mkN4l X-Received: by 10.99.110.202 with SMTP id j193mr3721029pgc.294.1518609134366; Wed, 14 Feb 2018 03:52:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518609134; cv=none; d=google.com; s=arc-20160816; b=0Xl2PBJaqKJXBJXMkvJoGRnLJj2VXb5q1CFod0MBFEsaYOed3Wx05ALV2YaleW3NAs AvSW1SjviJ3xSLpY/29+2Pero4o6fvHuaZK3z9DGzzmOdU6y3mf3ePhwQjgRWWJm2DXb tPG8jGqX+qkqvJwR31KssZaz8N5kQZY8P6xxh6oB9f5Ow/Iap8d/1swwv4uxyoarUOtG 6g07LpcY8uRxg5QGtv6W3Hrq8w7Aq83JrrG58lTo0BToOInWtG54+h55Q8pdlwiVOda5 4sOjkgGwh5Q1gyS8WB7jQaUczqsr20cxuWnh04icg2tbAEG72ycO14Hgo0M0ZUCmEyID 9zBw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=aRzVdK1TsRdKleQLkwRn7Ml5HviRJcLmlE0FLos3aJs=; b=b17F+hiBjnyw1rl0e5dLGLY+9syxl590H3d06CLspyvTz8b+jcvG/DlAh9gdaoIXC2 OeBaOkpWwkZTucxeqcPGCq0xMP9tH78OzafRde60TBnsLC/y1q7yaK4wPC4jpVCp4h6W 0QZ4SCc75q8+M/h6GR6fL0O8fqvAiO8QLszaOXYxUpAFdWXOHe8bcvOKltMjy1VIrYT+ UvDOu+GXRUXgfODGt1Gevg9/sq7rX4C58Cpv9svgOmh1uJdJdHvHaZpqFjXBGx+086s5 W9o81RDVyjeFZjTCiyt7m1+bgpJGEJoyiDAeXSdS4LxNFptbtWq37XvybJBEfZmjWhlj 0RiQ== 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 m39-v6si2777080plg.447.2018.02.14.03.52.00; Wed, 14 Feb 2018 03:52:14 -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; 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 S967555AbeBNLvZ (ORCPT + 99 others); Wed, 14 Feb 2018 06:51:25 -0500 Received: from mx2.suse.de ([195.135.220.15]:36502 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967378AbeBNLvX (ORCPT ); Wed, 14 Feb 2018 06:51:23 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C5F3BAAF1; Wed, 14 Feb 2018 11:51:21 +0000 (UTC) Date: Wed, 14 Feb 2018 12:51:19 +0100 From: Michal Hocko To: Jason Wang Cc: Daniel Borkmann , Matthew Wilcox , syzbot , akpm@linux-foundation.org, dhowells@redhat.com, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mingo@kernel.org, rppt@linux.vnet.ibm.com, syzkaller-bugs@googlegroups.com, vbabka@suse.cz, viro@zeniv.linux.org.uk, Alexei Starovoitov , netdev@vger.kernel.org, brouer@redhat.com, "Michael S. Tsirkin" Subject: Re: WARNING in kvmalloc_node Message-ID: <20180214115119.GA3443@dhcp22.suse.cz> References: <001a1144c4ca5dc9d6056520c7b7@google.com> <20180214025533.GA28811@bombadil.infradead.org> <20180214084308.GX3443@dhcp22.suse.cz> <24351362-a099-3317-2b96-8cdc6835eb1e@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <24351362-a099-3317-2b96-8cdc6835eb1e@redhat.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 14-02-18 19:47:30, Jason Wang wrote: > > > On 2018年02月14日 17:28, Daniel Borkmann wrote: > > [ +Jason, +Jesper ] > > > > On 02/14/2018 09:43 AM, Michal Hocko wrote: > > > On Tue 13-02-18 18:55:33, Matthew Wilcox wrote: > > > > On Tue, Feb 13, 2018 at 03:59:01PM -0800, syzbot wrote: > > > [...] > > > > > kvmalloc include/linux/mm.h:541 [inline] > > > > > kvmalloc_array include/linux/mm.h:557 [inline] > > > > > __ptr_ring_init_queue_alloc include/linux/ptr_ring.h:474 [inline] > > > > > ptr_ring_init include/linux/ptr_ring.h:492 [inline] > > > > > __cpu_map_entry_alloc kernel/bpf/cpumap.c:359 [inline] > > > > > cpu_map_update_elem+0x3c3/0x8e0 kernel/bpf/cpumap.c:490 > > > > > map_update_elem kernel/bpf/syscall.c:698 [inline] > > > > Blame the BPF people, not the MM people ;-) > > Heh, not really. ;-) > > > > > Yes. kvmalloc (the vmalloc part) doesn't support GFP_ATOMIC semantic. > > Agree, that doesn't work. > > > > Bug was added in commit 0bf7800f1799 ("ptr_ring: try vmalloc() when kmalloc() fails"). > > > > Jason, please take a look at fixing this, thanks! > > It looks to me the only solution is to revert that commit. Do you really need this to be GFP_ATOMIC? I can see some callers are under RCU read lock but can we perhaps do the allocation outside of this section? -- Michal Hocko SUSE Labs