Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2723739imm; Mon, 24 Sep 2018 08:55:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV60ARC85T57ZHXymgiQ41qY/gQcibpNXXgzGS/FKuRqmEmZ6/wtfWbn2BAFsye9u8icFdN++ X-Received: by 2002:a63:f501:: with SMTP id w1-v6mr10125581pgh.446.1537804542953; Mon, 24 Sep 2018 08:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537804542; cv=none; d=google.com; s=arc-20160816; b=IRfCqHWGu6TCQ/EHoijUUTNfelrE0Jwy6sxfz297GVmD10McmP2r/uhE9jftoI58vV ErZVSl5dsTVUzI28ebMQNW9IwTJ6SdWt+PVt2BdO9pMw5SuEPLntJ1aYyT1HaN8lWMU8 +sI0lOXpuFxnCchMzaTb/l7PMKqoMLJET5f8npJ+NjEbGZd/4tcLJzMgXFAXELdDi0CM vdATK+dCMG5OAEtyz8h8H/NrDUUYT9r5B4FDKx025vD2IeDhNVA1imV/PHKOPP/EF6/M yu9gnA9ulk5rRB1EPbWc3sCh0uJI8PtQ0s6BCaEmrYfOE9usbKD6PmJzGq5OljHn2OEk erEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=mjsnQ8/pmGiiw7bYlwxxPfgTABltP/jqKPiv2Rgwdls=; b=S8n/cAKESLlGiHhqNOV5KSdT/H/RlIcRVe3OOJjVhPML+ctuH8duQ6s5DY03Ocuvkt y50sDUDiIKWsnEGE+r/8jw/ntJBbOIwnzGEUaG9tvkwZ/eVgqjyktud+wnbS4HCLT+D4 YlQG36bZ/cH9kHxodGi+/WpBvMw0MvAoFop6soUIJ5DrfwAiUAV3tJnR1VyiGVA9Rh0V QXdsBidpPUT9g1rJaNbEl7VfRIsueKXd/6srR57tZW4ObC6C75gjXckyR9/WWE7UW38+ qdpEa9cOIteITGrypGFJc22e0bGFPmcrXwDaeUs5wMh87fRQJfpJqVn3qAyREluR7HnV YwdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=VQBH0tVA; 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 e3-v6si36341881pgh.385.2018.09.24.08.55.27; Mon, 24 Sep 2018 08:55:42 -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=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=VQBH0tVA; 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 S1729801AbeIXV5y (ORCPT + 99 others); Mon, 24 Sep 2018 17:57:54 -0400 Received: from a9-92.smtp-out.amazonses.com ([54.240.9.92]:41732 "EHLO a9-92.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728312AbeIXV5x (ORCPT ); Mon, 24 Sep 2018 17:57:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1537804504; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=jkm4O9apag7jq/yOWRqDujn9+uZfKY5xgF95ikWDcns=; b=VQBH0tVAFaTb8pQrkQu+8T2iSBwpYnGq4Cdot+TeM3tVoeImH4HPQUQus7Ove9Tc 3PGFMXrBYenuab/zD+35KwtsAx+kReJ3iXEu4a+o+u7eRMTPqqJg4GHloWqi5wWmuc+ Xt2jVMbKZqWaMWEbeCtG81Gy1/ykBJzLAcQWsmgY= Date: Mon, 24 Sep 2018 15:55:04 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Dmitry Vyukov cc: Dmitry Torokhov , syzbot+87829a10073277282ad1@syzkaller.appspotmail.com, Pekka Enberg , "linux-input@vger.kernel.org" , lkml , Henrik Rydberg , syzkaller-bugs , Linux-MM Subject: Re: WARNING: kmalloc bug in input_mt_init_slots In-Reply-To: Message-ID: <010001660c4a8bbe-91200766-00df-48bd-bc60-a03da2ccdb7d-000000@email.amazonses.com> References: <000000000000e5f76c057664e73d@google.com> <010001660c1fafb2-6d0dc7e1-d898-4589-874c-1be1af94e22d-000000@email.amazonses.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2018.09.24-54.240.9.92 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 24 Sep 2018, Dmitry Vyukov wrote: > On Mon, Sep 24, 2018 at 5:08 PM, Christopher Lameter wrote: > > On Sun, 23 Sep 2018, Dmitry Vyukov wrote: > > > >> What was the motivation behind that WARNING about large allocations in > >> kmalloc? Why do we want to know about them? Is the general policy that > >> kmalloc calls with potentially large size requests need to use NOWARN? > >> If this WARNING still considered useful? Or we should change it to > >> pr_err? > > > > In general large allocs should be satisfied by the page allocator. The > > slab allocators are used for allocating and managing small objects. The > > page allocator has mechanisms to deal with large objects (compound pages, > > multiple page sized allocs etc). > > I am asking more about the status of this warning. If it fires in > input_mt_init_slots(), does it mean that input_mt_init_slots() needs > to be fixed? If not, then we need to change this warning to something > else. Hmmm.. kmalloc falls back to the page allocator already? See static __always_inline void *kmalloc(size_t size, gfp_t flags) { if (__builtin_constant_p(size)) { if (size > KMALLOC_MAX_CACHE_SIZE) return kmalloc_large(size, flags); Note that this uses KMALLOC_MAX_CACHE_SIZE which should be smaller than KMALLOC_MAX_SIZE. How large is the allocation? AFACIT nRequests larger than KMALLOC_MAX_SIZE are larger than the maximum allowed by the page allocator. Thus the warning and the NULL return.