Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7321774imu; Thu, 27 Dec 2018 17:45:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN6NB13RhZXmbSc2UBw9OfRy3KkgI4u2ekwI5+IeO0rEV9SZlcxHW7QdGq0vy2InyITP4iPX X-Received: by 2002:a63:cd4c:: with SMTP id a12mr25200320pgj.252.1545961553217; Thu, 27 Dec 2018 17:45:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545961553; cv=none; d=google.com; s=arc-20160816; b=HyXI4Ko8ELMST9kshI3OYLEvAoUhUHbWD1B1EQkwhs8K7HQzwaIA+U3sIjxwhN9UP8 xtNUMgwgZdW7zAHbrTMtzPdwxzrODDUi4BjzMo8fZcUepFGwBs7pdXqBB6lWrhISWjzs RktHCqDsQagakp9+19oV96vuhH2cQNK7wB8s5TNWHHI28CX+rT2Tn9eyxijK2bJhfem1 Hbn0V19yAy7vD+nvuKXspNAxhDAMFVZq6lxE6C83LYnJHie+6uWD4AEPayLrBntNJXzW hTnv1MjvmFybiBljNmlLb+BoS1ZwQcEB39bIUzr2M7J8vneXi13AVf8zTUNDlpgZS5rQ Fb5g== 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; bh=zS0m2jaEDkwBfc4DfscEYwxqOooSIFoh/C0xJNNx3oc=; b=qwx01VfxBDpbDXtHiiZV5pVdVFRvwU4n7CPvizKGYEWgwXLFNplq1aom3lHGrNnrq8 bOkUg+HphagRclnwNOcUTShn16HXcJ7tA4QqXlKdGTwt2ag7uIvNhTwwG+JeqPgvrlwN +v99DuRX5OBNEGCB8bS173GusnC9dY3ApNVyCI7XmAbdqlFopbMqOOh3R0EIDEY9cVvH X1hDYyd2NAI5o5QNXQGwMHqxTzsV75eSeiHebpgUo8iTvu3zvG1s2N8fa5vHRlHZK9D+ G599efAZ/ADhnuWje58KL9i2FXtihbjUusX7nmtPfSek5olLqBuScE06S9JwgrnAA2bZ ObBA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si1846261plr.355.2018.12.27.17.45.38; Thu, 27 Dec 2018 17:45:53 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729129AbeL0Qu6 (ORCPT + 99 others); Thu, 27 Dec 2018 11:50:58 -0500 Received: from mx2.suse.de ([195.135.220.15]:39770 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727184AbeL0Qu5 (ORCPT ); Thu, 27 Dec 2018 11:50:57 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2C6F5AF3B; Thu, 27 Dec 2018 16:50:56 +0000 (UTC) Date: Thu, 27 Dec 2018 17:50:55 +0100 From: Michal Hocko To: Konstantin Khorenko Cc: Andrew Morton , Andrey Ryabinin , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Luis Chamberlain , Kees Cook Subject: Re: [PATCH 1/1] mm/page_alloc: add a warning about high order allocations Message-ID: <20181227165055.GN16738@dhcp22.suse.cz> References: <20181225153927.2873-1-khorenko@virtuozzo.com> <20181225153927.2873-2-khorenko@virtuozzo.com> <20181226084051.GH16738@dhcp22.suse.cz> <12c71c7a-7896-df73-7ab4-eab5b6fc1fb0@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12c71c7a-7896-df73-7ab4-eab5b6fc1fb0@virtuozzo.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 27-12-18 16:05:18, Konstantin Khorenko wrote: > On 12/26/2018 11:40 AM, Michal Hocko wrote: > > Appart from general comments as a reply to the cover (btw. this all > > should be in the changelog because this is the _why_ part of the > > justification which should be _always_ part of the changelog). > > Thank you, will add in the next version of the patch alltogether > with other changes if any. > > > On Tue 25-12-18 18:39:27, Konstantin Khorenko wrote: > > [...] > >> +config WARN_HIGH_ORDER > >> + bool "Enable complains about high order memory allocations" > >> + depends on !LOCKDEP > > > > Why? > > LOCKDEP makes structures big, so if we see a high order allocation warning > on a debug kernel with lockdep, it does not give us a lot - lockdep enabled > kernel performance is not our target. > i can remove !LOCKDEP dependence here, but then need to adjust default > warning level i think, or logs will be spammed. OK, I see but this just points to how this is not really a suitable solution for the problem you are looking for. > >> +static __always_inline void warn_high_order(int order, gfp_t gfp_mask) > >> +{ > >> + static atomic_t warn_count = ATOMIC_INIT(32); > >> + > >> + if (order >= warn_order && !(gfp_mask & __GFP_NOWARN)) > >> + WARN(atomic_dec_if_positive(&warn_count) >= 0, > >> + "order %d >= %d, gfp 0x%x\n", > >> + order, warn_order, gfp_mask); > >> +} > > > > We do have ratelimit functionality, so why cannot you use it? > > Well, my idea was to really shut up the warning after some number of messages > (if a node is in production and its uptime, say, a year, i don't want to see > many warnings in logs, first several is enough - let's fix them first). OK, but it is quite likely that the system is perfectly healthy and unfragmented after fresh boot when doing a large order allocations is perfectly fine. Note that it is smaller order allocations that generate fragmentation in general. -- Michal Hocko SUSE Labs