Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11199094ybi; Thu, 25 Jul 2019 11:44:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzu+m/5p6hsB9+xwFwiE835K5ulW537QrJ1l1CoMfd26Vc+vXG/0w+ePNLaCD7uClFjoS49 X-Received: by 2002:a17:902:8a8a:: with SMTP id p10mr94103800plo.88.1564080275272; Thu, 25 Jul 2019 11:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564080275; cv=none; d=google.com; s=arc-20160816; b=YuBebKmh31nUj4NUMyKTAaQ2OQ/JiGNVrH/tVqBirCNlgUtjAASM0aNPsNNnUtBoHK o+gRVz73lTob8D+TxW8qOQljwR6OIcpzrxTkP6LKk4v3G73vIKimIbchpODFutrauJqt uuPleJEakaUKAzPv8PnRuw45uXiag9lcotEeW0bG6RgJhsT76BZEfJfVluEDvqzhTPMv A5HJkUtagpKhslcuDdQhPk46P1OZWBvSJwz09ENAD9K8TrDf95AUUjXWaBrpJiR4oF8A IHmjXJ2KP8o6wgjCo92Z8ZRxD21ZTp9cEuWfyWDn/84clAJ2JSzrAgyzVSwJvupYEBXp SNdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OxsBtkR8V6+s0OkCC+Hu7HIqYT8kxjr7WRYhfDwWQac=; b=CAnxWMvxQH0y0WGMW3uYK9i9KYY6/YVAuRD3zX6ijPGdeT3Fcx78C51mS2ACFh/yof RmWSuCSEhdynBr6Q5aGBp8q0t1EtmU4j3ig6sng0sLbIneg/kcI0VLd/oAAN0qhLa6tl 4N18EN2iYDbA5IABGB4SERIqxrM7yyzYNF8Bn7j6QR1RZ32zoslsRToGs+Vf0GCSNwU8 0UoIx4BnruJX6P/wS+GRqSKekknZ+6qHxcvs3mWe11Rqc6naFm6RrwDws6kpDx0zJ8Jo Q6Ic4MGarh6+1NMsbU15BXvDd6kMDjQGQQ8J4+7sxGEv57f+bJGRFBgJKChnf9JwF2HE QnuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ry2zmLqy; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 184si20346912pga.23.2019.07.25.11.44.20; Thu, 25 Jul 2019 11:44:35 -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=@gmail.com header.s=20161025 header.b=ry2zmLqy; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726271AbfGYSnj (ORCPT + 99 others); Thu, 25 Jul 2019 14:43:39 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:46732 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726086AbfGYSnj (ORCPT ); Thu, 25 Jul 2019 14:43:39 -0400 Received: by mail-pf1-f193.google.com with SMTP id c3so54123pfa.13 for ; Thu, 25 Jul 2019 11:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OxsBtkR8V6+s0OkCC+Hu7HIqYT8kxjr7WRYhfDwWQac=; b=ry2zmLqy2lsaOf19QbIYeTpO253PbKl4qzCc1S9mFX+H9n3B+/+5u83D1qe5RePhVE TOyPjcoM92ICenSmuv7isTDBNg2TZUX4CZ8vOcuARZ9WvJ5OLO7oE9lip/0QLEmYnyo7 MpXJTJPjkL2/X2ge8PyV40QreWCZaWZDFQIAy7f+Zb9QR2NiEGbLtQSchU5EFKj7uktJ eR3tbUXE5U30f/r8yHwKI2Yth+uYH+Bpn3aWc8EQzx2JVNnRkCZmnpyBvEMr6BHvQOIY kEjVrQWbskaEntYS6HGUzlzdlG473FUzeVUnyks1SV5C6E6xKjIzV6Kkh6/5Ps6ytE8c A7YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OxsBtkR8V6+s0OkCC+Hu7HIqYT8kxjr7WRYhfDwWQac=; b=Oh7Zn3Hkypy2SL5ci0teiHOlY032X1exxDpKKawtlVJ85BHH+X6SlFb0lDkqQL1YC0 gjykwDLAOIOJo2wZPA7ICia8vg+Gk4W2+Lk8cfSmQwUvznMz8QSK3CML5ZXrszHc1+Sg sxECeQLiGc1CAVvS1bjtpr0AxEkNtgvuGbgbzAwSVKFq2m+SS2uWh8tgeGwBMaz3VuPv 5TpSLPcDhQQbat4oop9n3GrwAJYuk1AXGFR9wufpH9xDTuxdoS00C8JZ8prxwvnoTdka mMpAL4aebOXxtfPh7k6gEhJllQumB7x59FD1wWf5gG8515NiCvFYqiNyliqnB42VNjSA BbYQ== X-Gm-Message-State: APjAAAUeSjDwpzO1JalYPaV3q3rJwKDMsR8oJ2Uv2HyDkk9q7/7qf1rP bCTUjtT2AQ9fIMouHFm1KAY= X-Received: by 2002:a62:3347:: with SMTP id z68mr18528585pfz.174.1564080219029; Thu, 25 Jul 2019 11:43:39 -0700 (PDT) Received: from localhost.localdomain.localdomain ([2408:823c:c11:624:b8c3:8577:bf2f:3]) by smtp.gmail.com with ESMTPSA id w3sm43818257pgl.31.2019.07.25.11.43.31 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 25 Jul 2019 11:43:38 -0700 (PDT) From: Pengfei Li To: akpm@linux-foundation.org Cc: mgorman@techsingularity.net, mhocko@suse.com, vbabka@suse.cz, cai@lca.pw, aryabinin@virtuozzo.com, osalvador@suse.de, rostedt@goodmis.org, mingo@redhat.com, pavel.tatashin@microsoft.com, rppt@linux.ibm.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Pengfei Li Subject: [PATCH 01/10] mm/page_alloc: use unsigned int for "order" in should_compact_retry() Date: Fri, 26 Jul 2019 02:42:44 +0800 Message-Id: <20190725184253.21160-2-lpf.vector@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190725184253.21160-1-lpf.vector@gmail.com> References: <20190725184253.21160-1-lpf.vector@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Like another should_compact_retry(), use unsigned int for "order". And modify trace_compact_retry() accordingly. Signed-off-by: Pengfei Li --- include/trace/events/oom.h | 6 +++--- mm/page_alloc.c | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/trace/events/oom.h b/include/trace/events/oom.h index 26a11e4a2c36..b7fa989349c7 100644 --- a/include/trace/events/oom.h +++ b/include/trace/events/oom.h @@ -154,7 +154,7 @@ TRACE_EVENT(skip_task_reaping, #ifdef CONFIG_COMPACTION TRACE_EVENT(compact_retry, - TP_PROTO(int order, + TP_PROTO(unsigned int order, enum compact_priority priority, enum compact_result result, int retries, @@ -164,7 +164,7 @@ TRACE_EVENT(compact_retry, TP_ARGS(order, priority, result, retries, max_retries, ret), TP_STRUCT__entry( - __field( int, order) + __field(unsigned int, order) __field( int, priority) __field( int, result) __field( int, retries) @@ -181,7 +181,7 @@ TRACE_EVENT(compact_retry, __entry->ret = ret; ), - TP_printk("order=%d priority=%s compaction_result=%s retries=%d max_retries=%d should_retry=%d", + TP_printk("order=%u priority=%s compaction_result=%s retries=%d max_retries=%d should_retry=%d", __entry->order, __print_symbolic(__entry->priority, COMPACTION_PRIORITY), __print_symbolic(__entry->result, COMPACTION_FEEDBACK), diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 272c6de1bf4e..75c18f4fd66a 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3940,10 +3940,9 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order, } static inline bool -should_compact_retry(struct alloc_context *ac, int order, int alloc_flags, - enum compact_result compact_result, - enum compact_priority *compact_priority, - int *compaction_retries) +should_compact_retry(struct alloc_context *ac, unsigned int order, + int alloc_flags, enum compact_result compact_result, + enum compact_priority *compact_priority, int *compaction_retries) { int max_retries = MAX_COMPACT_RETRIES; int min_priority; -- 2.21.0