Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2194644imm; Thu, 27 Sep 2018 08:52:04 -0700 (PDT) X-Google-Smtp-Source: ACcGV60Q6vH5v/uhfGWlkcX2DYQwf4woliHuynZf5zHCqPQw2rN9ZqMZn63ioG+Ap+Yucj0uuX6j X-Received: by 2002:a63:e14a:: with SMTP id h10-v6mr10849290pgk.358.1538063524749; Thu, 27 Sep 2018 08:52:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538063524; cv=none; d=google.com; s=arc-20160816; b=FaFvxA5OA8vc7+dYiUhnEpxC26mBM2+jZrq8PzkCTxKwRNrjoGWuOKhJZC5dr+mcea jmSW2ZholR/U4iLvV68pZLaC9eSl3Ozwlnz4UZfPCJPtWmadKNoXExiGKf+a4/6ZMRNf pmp3ScxAWh0gMwroIhPNj8M0vQK/1jwCwsY6AI/bmWqS2OM0PsqHaaUpWOGqefWh3N25 Lp78grIBeGpmH21kLzTf/QfWRlKjsMtZqNjAW0mtgRYu8pwMjRGTmbWuXA6wxwOiwzQM I/AwHQvDywwyfV9C5Q5mcVA90bQTCLjRtnZ45yZFftArBDtuW0TuLnHs5UwG+GTQ8ntH 8XXw== 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=hR2a9hgOe1QRCBus72KewrkyO1ERzF2MY5w6erYJanI=; b=WVNjQ15yxebOCF5qb2UoDMHn2zYC76u7ND3W5zUWrS1OHCQ6N3Tg7pbpI2olBBzA6k zCyilEaZ9OWU1Hh4bMnOHftJmlKvaeTnqTqVk0q6zfaK8VV+Tg8CBs0xt/qe/NA5K5z+ 1JAqbkX8+k6RyLZz8Uc+dj8Y5lNb2emoKnJLDC5I0kiMWDPzz1ouw/3bZOSa9QekxcKr PkmvK1hqmEJ93D0ZkwyjsG6Uv0e4F1vREsqFYzV4vgISM8gnkmVhmUpp3222FfSFOYnJ UdWL1b/8uViFfStXgeNl9wAdZkWLyWQCSFZAVJEjKkW+3cEFi44q0PRTrtcCDltsIDbw nZfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=ZP1mrXp5; 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 l136-v6si2447565pfd.132.2018.09.27.08.51.47; Thu, 27 Sep 2018 08:52:04 -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=ZP1mrXp5; 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 S1727987AbeI0WKL (ORCPT + 99 others); Thu, 27 Sep 2018 18:10:11 -0400 Received: from a9-54.smtp-out.amazonses.com ([54.240.9.54]:33962 "EHLO a9-54.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727597AbeI0WKL (ORCPT ); Thu, 27 Sep 2018 18:10:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1538063477; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=hR2a9hgOe1QRCBus72KewrkyO1ERzF2MY5w6erYJanI=; b=ZP1mrXp5JEPwUxETfj9h3dBxx1e7WhHDKgFW2llgwGdIkY4L6Voce8W8rHN5rSTm 7Vm+NlKswP6jmvUsQOm6mv1SOZ6ZFlVeFdiG5tmk6FH8mRwNKdvxd3mvouOJVue6/fH ODJ2d0DTWtYORLkUbSiXG1icl1KsF8yOPSuFu6Xg= Date: Thu, 27 Sep 2018 15:51:17 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Dmitry Vyukov cc: penberg@kernel.org, akpm@linux-foundation.org, rientjes@google.com, iamjoonsoo.kim@lge.com, Dmitry Vyukov , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: don't warn about large allocations for slab In-Reply-To: <20180927130707.151239-1-dvyukov@gmail.com> Message-ID: <010001661bba2bbc-a5074e00-2009-414a-be8c-05c58545c7ec-000000@email.amazonses.com> References: <20180927130707.151239-1-dvyukov@gmail.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.27-54.240.9.54 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 Thu, 27 Sep 2018, Dmitry Vyukov wrote: > From: Dmitry Vyukov > > This warning does not seem to be useful. Most of the time it fires when > allocation size depends on syscall arguments. We could add __GFP_NOWARN > to these allocation sites, but having a warning only to suppress it > does not make lots of sense. Moreover, this warnings never fires for > constant-size allocations and never for slub, because there are > additional checks and fallback to kmalloc_large() for large allocations > and kmalloc_large() does not warn. So the warning only fires for > non-constant allocations and only with slab, which is odd to begin with. > The warning leads to episodic unuseful syzbot reports. Remote it. /Remove/ If its only for slab then KMALLOC_MAX_CACHE_SIZE and KMALLOC_MAX_SIZE are the same value. > While we are here also fix the check. We should check against > KMALLOC_MAX_CACHE_SIZE rather than KMALLOC_MAX_SIZE. It all kinda > worked because for slab the constants are the same, and slub always > checks the size against KMALLOC_MAX_CACHE_SIZE before kmalloc_slab(). > But if we get there with size > KMALLOC_MAX_CACHE_SIZE anyhow > bad things will happen. Then the WARN_ON is correct just change the constant used. Ensure that SLAB does the same checks as SLUB.