Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp206932ybb; Fri, 27 Mar 2020 19:55:56 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs61g3lagz1dUA4NJpd3mEqxd2MZ5dM21vxIh3nj03z4o7qXlqGS9t7CyKmI2gOouUVgGaL X-Received: by 2002:aca:130f:: with SMTP id e15mr1292013oii.160.1585364156157; Fri, 27 Mar 2020 19:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585364156; cv=none; d=google.com; s=arc-20160816; b=ILNWJf1e7uWPJtb5YhTEjEjWBf8/cmwKhfLYEGEHd4QUcVvKL7ghMtNDoM7y5uW2CD UXR60dj7Wm8CvK+O08R8pC/PM8HukmfnPNuJAMPJIhdKHldFu65qYM0bta2EoG77tjec f2dK9sPie6X25Q9raR2xFsfVNZdHV/PzsiJuU44R2MrD2qnXuQjIZ77hM5KoYxY1fg4N cOhUkmhqAO4D69ilt6Jjc+r5ddBzkFFSjYlu2aCZdzgMUTga7e8Gz/4Pk8b23Xv+vyCg 1Jc1F+SuLo4w2is8ypniU8tXUpkAlPBRt3vXyScKBZWAd9zBL7U2b8eua8Ntl2+mUUGo JFUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=4AUK5iDi3YWEjQuB/5VsdC79nW2cU/c1Z4Dkvzca3gU=; b=QvdX5Pc4W3nadxfWBP+vxswKlPqnRY5ljYk37jZpd5Pn1bwzVlD+4dfbgNoTG7bHa8 uCqJUyYyMPhj0hynQP0Bpryx0ja4jD0Dh4sTY8ElQG5BHzSEJ5Hw0nBvTe/7GZV2/cKU HJM1+XWgkt0HPqt5dZ3pUzaDTOCEdf3lVG5ROAuqt2nk8zbTQLZI16YXk0lh1nlLYfoB 0ziUp9luOxX1qc8yl9S2U2wNNbCvmjyDFFLUulSc9O3g4GyfcpyWOU32nA33XXjLrlUy ZQ77mZB8BF57/NhJ17yeJ3D0H4Gy8oM3MN6AQUso7UhsiC3Bdgq8AhVzsBWqjhtWapGM SoUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=vNC33ELS; dkim=temperror (no key for signature) header.i=@fluxnic.net header.s=2016-12.pbsmtp header.b=HyLMTyrU; 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 m16si3131648ooq.88.2020.03.27.19.55.42; Fri, 27 Mar 2020 19:55:56 -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=@pobox.com header.s=sasl header.b=vNC33ELS; dkim=temperror (no key for signature) header.i=@fluxnic.net header.s=2016-12.pbsmtp header.b=HyLMTyrU; 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 S1726956AbgC1CzV (ORCPT + 99 others); Fri, 27 Mar 2020 22:55:21 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:61579 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726518AbgC1CzV (ORCPT ); Fri, 27 Mar 2020 22:55:21 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id A3E86BBA3F; Fri, 27 Mar 2020 22:55:19 -0400 (EDT) (envelope-from nico@fluxnic.net) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sasl; bh=sSqb30NNQNqTsRknQ8lLupar/mE=; b=vNC33E LSGl3qIU7V1DJYieTA0b9SjQDataFVKlJh2Er126pDxr0rMIbVR5sb86lFLmWbOG RjHgrjVejLXJqrToicwK4iaWajnl3bHXFkXKXQIHv4QEmnudNxBvsSUcFB39OIdZ QqTunpP69TTC7gT4/LotMdwfngYY/Nq8h8+Xk= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 9A764BBA3E; Fri, 27 Mar 2020 22:55:19 -0400 (EDT) (envelope-from nico@fluxnic.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=fluxnic.net; h=date:from:to:cc:subject:in-reply-to:message-id:references:mime-version:content-type; s=2016-12.pbsmtp; bh=kMBm7Q4AhHCbPnyWnAC5N85IkTkWQ/zsEXlcMmQI1eo=; b=HyLMTyrUhBpkuSWwYNO0K2veNsYjRr6ddfRxK0sMpiL/jKjyd8Z/QWUmoCB/349A9Jh1ao2d035KqrUuL3xU7hzLV8CGz83Y6HCfYgpWPvrhwA5HhafAU2WnfFC+oU6GjdpBJF9Dv+gVfYuVSRsYD8KI60GJ50trk5b6AFWS4Ds= Received: from yoda.home (unknown [24.203.50.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 90B5EBBA3D; Fri, 27 Mar 2020 22:55:16 -0400 (EDT) (envelope-from nico@fluxnic.net) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTPSA id A7ADD2DA01B0; Fri, 27 Mar 2020 22:55:14 -0400 (EDT) Date: Fri, 27 Mar 2020 22:55:14 -0400 (EDT) From: Nicolas Pitre To: Chen Wandun cc: jslaby@suse.com, gregkh@linuxfoundation.org, daniel.vetter@ffwll.ch, sam@ravnborg.org, b.zolnierkie@samsung.com, lukas@wunner.de, ghalat@redhat.com, kilobyte@angband.pl, linux-kernel@vger.kernel.org Subject: Re: [PATCH next] vt: fix a warning when kmalloc alloc large memory In-Reply-To: <20200328021340.27315-1-chenwandun@huawei.com> Message-ID: References: <20200328021340.27315-1-chenwandun@huawei.com> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Pobox-Relay-ID: 8D9B5CC4-709F-11EA-9B54-B0405B776F7B-78420484!pb-smtp20.pobox.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 28 Mar 2020, Chen Wandun wrote: > If the memory size that use kmalloc() to allocate exceed MAX_ORDER pages, > it will hit the WARN_ON_ONCE(!(gfp_mask & __GFP_NOWARN)), so add memory > allocation flag __GFP_NOWARN to silence a warning, othervise, it will > cause panic if panic_on_warn is enable. Wow! How do you manage that? You need something like a 1024x1024 text screen to get such a big memory allocation. Still, GFP_NOWARN is not a proper fix. This kmalloc() should rather be replaced by vmalloc(), and corresponding kfree() should then be vfree(). There is no need for this allocation to be physically contiguous. Nicolas