Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp522950rwd; Wed, 7 Jun 2023 03:26:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hZ2YLP3VTker+LfmrkuuD73ytB/K+M4tpC6vZfBmUwENw9qWfLZ2susltVz8QLWfHyWd7 X-Received: by 2002:a05:6a20:394a:b0:102:3f67:dbe1 with SMTP id r10-20020a056a20394a00b001023f67dbe1mr3117964pzg.4.1686133565844; Wed, 07 Jun 2023 03:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686133565; cv=none; d=google.com; s=arc-20160816; b=TdnRjuYWmR6gxumuif/Rb657h6zDo7CHPXdWGrP/V0pQNN7dEbpcamP/JtAtDY5ckp xeDccglpTgAB3baRQWiNvyKAJAkJq/VIdjvfxBBpE7zxWSPNSD+xKzxKeDSk/D0/OK6/ mekLwrnOVFJRSVx/o07LgotFJSF+b0f4OAsCYAnicJ1z2CtmJCUGcJ+LQowFVdR1bcMg j+ZvVfUZOn4nqT5Ev2C6xNjMTYslwr1jNs+7jlSE4TJxaX584AlwvhHq9W1kpBxi/0aK kOnb+tnKSi7LWgR+flMlF/NnSDhXi9nGrZRs1MGApmHBL8QUPH5hAlw5lTws/gLKX/mn TDJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OtOZgD95z/IBl7SqKk0BG6TOYMfHhxxJyQnJ1HGyzbM=; b=SD+CNUbxDxbLU5CtDBB3/ttWxoeCBr6bhAG8+Q1xEbrBnrlJOltvweiggxAYvVzTSi KoJieya4uF+Q+YesHelJifoSX1Drlp5PQ9TYwzOhXRS5y2ErObx/PdUJe/1x/Mx4Ig0O nCRJ3mEIpulE7xsunFVSg0ZdjDhAciJ7J16xKo3ypNmXHgkWts56dAwpwQyQ/xpAtTkq NymGjBDhWejamoXoNvf4HBswE/onK5YOe50jyiRZ1guAfaHWh/RWmOqOWhWfVNGXNPa5 YFZ93MJ2EfxxR0o9hVlSFus6OlXTHGWyL+S+U0yW8iU8OrrUL7dWPFDQzfF6ZATGFNLN KE+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=UldiIttJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k62-20020a636f41000000b005211941267asi8443230pgc.153.2023.06.07.03.25.51; Wed, 07 Jun 2023 03:26:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=UldiIttJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238654AbjFGKQS (ORCPT + 99 others); Wed, 7 Jun 2023 06:16:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238843AbjFGKQM (ORCPT ); Wed, 7 Jun 2023 06:16:12 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C419C1BD0 for ; Wed, 7 Jun 2023 03:16:08 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 4BC0B1FDAE; Wed, 7 Jun 2023 10:16:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1686132967; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OtOZgD95z/IBl7SqKk0BG6TOYMfHhxxJyQnJ1HGyzbM=; b=UldiIttJJHN/rLQo5Q+nk5SR9MQ1ebiuV5HR+bfplwSBDy3eEkESROO/aI426UWBykaMW/ 77G9jOiMKjIxVIVc+EDuXjrq943SMpFUMjQxMceAkyrN8eO6EF6LWVwLEZiF8S01JoAOmS iHaCxXxZb3oyxZW/4XDnafFP+JdFIqM= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3C99713776; Wed, 7 Jun 2023 10:16:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id +uohDudYgGTTeQAAMHmgww (envelope-from ); Wed, 07 Jun 2023 10:16:07 +0000 Date: Wed, 7 Jun 2023 12:16:06 +0200 From: Michal Hocko To: Haifeng Xu Cc: rppt@kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/mm_init.c: add debug messsge for dma zone Message-ID: References: <20230607090734.1259-1-haifeng.xu@shopee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230607090734.1259-1-haifeng.xu@shopee.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 07-06-23 09:07:34, Haifeng Xu wrote: > If freesize is less than dma_reserve, print warning message to report > this case. Why? > Signed-off-by: Haifeng Xu > --- > mm/mm_init.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/mm/mm_init.c b/mm/mm_init.c > index 232efac9a929..9a9d6a52471c 100644 > --- a/mm/mm_init.c > +++ b/mm/mm_init.c > @@ -1561,9 +1561,14 @@ static void __init free_area_init_core(struct pglist_data *pgdat) > } > > /* Account for reserved pages */ > - if (j == 0 && freesize > dma_reserve) { > - freesize -= dma_reserve; > - pr_debug(" %s zone: %lu pages reserved\n", zone_names[0], dma_reserve); > + if (j == 0) { > + if (freesize >= dma_reserve) { > + freesize -= dma_reserve; > + pr_debug(" %s zone: %lu pages reserved\n", > + zone_names[0], dma_reserve); > + } else > + pr_warn(" %s zone: %lu reserved pages exceeds freesize %lu\n", > + zone_names[0], dma_reserve, freesize); > } > > if (!is_highmem_idx(j)) > -- > 2.25.1 -- Michal Hocko SUSE Labs