Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp213972imu; Fri, 16 Nov 2018 21:21:07 -0800 (PST) X-Google-Smtp-Source: AJdET5dbTLNdyfdjzgiPG6XzbXyzv4RkeFnZuJoGordM78tv4ZWLwL0AuVFRNi+2KMBPAvdCBuIu X-Received: by 2002:a62:cf02:: with SMTP id b2mr6794676pfg.183.1542432067154; Fri, 16 Nov 2018 21:21:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542432067; cv=none; d=google.com; s=arc-20160816; b=wz4oewvS2I6dVlxnPiS4TsGiI0FxGcRq6DAYYq0/Q+CJaSpTaAafg6aX7bd6unRc7A 3nLsdjmyvg+xPx5scUciy8cAS9RTBIkB8oxWwy67WZ36IGUwao2toBSeXDbdLU3oIGZc hqPCXOU7CEKF56e0+8w6izvdIxGFTYGNVL1yrkhDAGjQdmveyV6zFaGhZQiY+HsQ7mRF 7wEagiYiZsijj3tLW1NhnsDpIsDzMuQtqO0CFsrYUbKYq1svi34eSTUf2N5QHfAMesV7 W7pjUaQMOixpreGUrpO1RjN3/ab3dzBrxKDMHPRXjBxQy9n/6Qs4dxhDdgDfI4G6/K// wb2Q== 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; bh=a7dNnNkvZDAMWYUfe3qtXZ1duI1DtoS9WPn8Xt85hKg=; b=Z5JUB1xKbpPSMPZt8drst3EeL32+med50QmMuf7r3qx1aPsjQrENFxKaHyiaRmxZDY 0jn7oJIMLNzepiy0pYfCSUSBJnjiruZJ23t6uQahcmHdmKAFbEJnVDLSC1vLzq0JNcmb JRil7SqZ7F6YfUfHnDPt/Pmom992tgh42vIrxnWqq+M3bIS5fo99WgA8Fg3q5HYyP3zK F9qeLgAvAAtDLttZk3eip2gTFzmnwWW+qUxG5Ctc633WFMEQ1/d1Zwj7nRAPwIAbSVRA 01STH6qNw28J2BZbhvoKTH1iwXSCjycnv2pkEvq/L2k/xfRju7T4m+04M2lkd+hgy9r6 9bwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EKT3I168; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p11-v6si32065615pgb.563.2018.11.16.21.20.51; Fri, 16 Nov 2018 21:21:07 -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=@gmail.com header.s=20161025 header.b=EKT3I168; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725854AbeKQPfm (ORCPT + 99 others); Sat, 17 Nov 2018 10:35:42 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:34697 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725784AbeKQPfm (ORCPT ); Sat, 17 Nov 2018 10:35:42 -0500 Received: by mail-pl1-f193.google.com with SMTP id f12-v6so12109685plo.1; Fri, 16 Nov 2018 21:20:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=a7dNnNkvZDAMWYUfe3qtXZ1duI1DtoS9WPn8Xt85hKg=; b=EKT3I168RNuTaxLaYO4b16UdsepPEGKYf1LLXGUqShilsYCRb7ooG4n7mLiyQ/sf9o Vbm7CTD+owvdpSpSjvJzeAdDP/0Ex3zXtp2lbTMM2sZHQr3c7Rbzuz35tBr4bDKMKV5Z lARBjOa7MzriH1DzFiQY9NVne9WbjfA5vSil/Bx1iHaAWuzI1oplw1UC8pY+6y6YNEPz tGc1guHUpqXkbQpUbc3+UlGnF1HyiW1qqvMwqlquhPWOu3cPqy+HTneHgBvIWlHqSI+M OMaaortF4Lm8EL1KnziqYSCXkjwwivXVb0XWqNd3Z2bmGG7LEVkPODbXcw2WSnIz4CfW TTVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=a7dNnNkvZDAMWYUfe3qtXZ1duI1DtoS9WPn8Xt85hKg=; b=nu+CAkIn3UVZ2hn6P2x70XYFmB9JvKs4AZVMqmxdbIxxm8zLsOUts5CpCYp1ysk5bV HYCK3AVCR07DV3aW8TUH8r3+vbjO110r2foq/zx8sKJOo2ubLfKTVF+nxhfgqwDxhI6e 2MvsApDlNfr6wPAvbZI0R66xJb5oyHfJKh6PsDSIbvdm27O0VqxF8WysBMij75XPFtcz nBhS8wcMREwVhotNKBfOhhqpFiWWS7vNIiJFCSSYwzazsul9AQDsnQ0dVDwpgCnWkf0E lwrbyXY+XGF7luc/aoenplUWMj0TkgXZSVw1fHy2ttP/rapO/5gwXoUSWv6AWMMbJqvZ mCRA== X-Gm-Message-State: AGRZ1gJCOrf0G+KzlYleXvkpHBZVtuc8vZqMZ6b6KkrZbjIp7bSGtmYl cyjS229QFKtS1eAnbOPo4Dw= X-Received: by 2002:a17:902:7848:: with SMTP id e8mr14084329pln.100.1542432014133; Fri, 16 Nov 2018 21:20:14 -0800 (PST) Received: from ast-mbp.dhcp.thefacebook.com ([2620:10d:c090:180::1:eb1f]) by smtp.gmail.com with ESMTPSA id s9sm25073880pgl.88.2018.11.16.21.20.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 21:20:13 -0800 (PST) Date: Fri, 16 Nov 2018 21:20:11 -0800 From: Alexei Starovoitov To: Roman Gushchin Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, Roman Gushchin , daniel@iogearbox.net Subject: Re: [PATCH bpf] bpf: allocate local storage buffers using GFP_ATOMIC Message-ID: <20181117052010.y3ta6vsdmye7iah5@ast-mbp.dhcp.thefacebook.com> References: <20181114180034.25558-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181114180034.25558-1-guro@fb.com> User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 14, 2018 at 10:00:34AM -0800, Roman Gushchin wrote: > Naresh reported an issue with the non-atomic memory allocation of > cgroup local storage buffers: > > [ 73.047526] BUG: sleeping function called from invalid context at > /srv/oe/build/tmp-rpb-glibc/work-shared/intel-corei7-64/kernel-source/mm/slab.h:421 > [ 73.060915] in_atomic(): 1, irqs_disabled(): 0, pid: 3157, name: test_cgroup_sto > [ 73.068342] INFO: lockdep is turned off. > [ 73.072293] CPU: 2 PID: 3157 Comm: test_cgroup_sto Not tainted > 4.20.0-rc2-next-20181113 #1 > [ 73.080548] Hardware name: Supermicro SYS-5019S-ML/X11SSH-F, BIOS > 2.0b 07/27/2017 > [ 73.088018] Call Trace: > [ 73.090463] dump_stack+0x70/0xa5 > [ 73.093783] ___might_sleep+0x152/0x240 > [ 73.097619] __might_sleep+0x4a/0x80 > [ 73.101191] __kmalloc_node+0x1cf/0x2f0 > [ 73.105031] ? cgroup_storage_update_elem+0x46/0x90 > [ 73.109909] cgroup_storage_update_elem+0x46/0x90 > > cgroup_storage_update_elem() (as well as other update map update > callbacks) is called with disabled preemption, so GFP_ATOMIC > allocation should be used: e.g. alloc_htab_elem() in hashtab.c. > > Reported-by: Naresh Kamboju > Tested-by: Naresh Kamboju > Signed-off-by: Roman Gushchin > Cc: Alexei Starovoitov > Cc: Daniel Borkmann applied to bpf tree, thanks