Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753290AbdI1OwS (ORCPT ); Thu, 28 Sep 2017 10:52:18 -0400 Received: from mail-qk0-f172.google.com ([209.85.220.172]:54615 "EHLO mail-qk0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752357AbdI1OwQ (ORCPT ); Thu, 28 Sep 2017 10:52:16 -0400 X-Google-Smtp-Source: AOwi7QBsjLmrp3xOJh2BhYh0CyyZhgMQuQB37UaY/Xu/+9eDc1jOQmpoKAHcbwdCD6TsDDrWIHJM3Q== Date: Thu, 28 Sep 2017 07:52:11 -0700 From: Tejun Heo To: Mark Rutland Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, syzkaller@googlegroups.com, Daniel Borkmann , "David S. Miller" , Alexei Starovoitov , Christoph Lameter Subject: Re: EBPF-triggered WARNING at mm/percpu.c:1361 in v4-14-rc2 Message-ID: <20170928145211.GD15129@devbig577.frc2.facebook.com> References: <20170928112727.GA11310@leverpostej> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170928112727.GA11310@leverpostej> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 883 Lines: 25 Hello, On Thu, Sep 28, 2017 at 12:27:28PM +0100, Mark Rutland wrote: > diff --git a/mm/percpu.c b/mm/percpu.c > index 59d44d6..f731c45 100644 > --- a/mm/percpu.c > +++ b/mm/percpu.c > @@ -1355,8 +1355,13 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved, > bits = size >> PCPU_MIN_ALLOC_SHIFT; > bit_align = align >> PCPU_MIN_ALLOC_SHIFT; > > - if (unlikely(!size || size > PCPU_MIN_UNIT_SIZE || align > PAGE_SIZE || > - !is_power_of_2(align))) { > + if (unlikely(size > PCPU_MIN_UNIT_SIZE)) { > + pr_warn("cannot allocate pcpu chunk of size %zu (max %zu)\n", > + size, PCPU_MIN_UNIT_SIZE); WARN_ONCE() probably is the better choice here. We wanna know who tries to allocate larger than the supported size and increase the size limit if warranted. Thanks. -- tejun