From patchwork Wed Jan 9 11:16:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mel Gorman X-Patchwork-Id: 10753873 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5A4866C2 for ; Wed, 9 Jan 2019 11:16:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4786328E77 for ; Wed, 9 Jan 2019 11:16:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BA1928EB5; Wed, 9 Jan 2019 11:16:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35EF428E77 for ; Wed, 9 Jan 2019 11:16:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5E9E28E00A4; Wed, 9 Jan 2019 06:16:13 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5710F8E0038; Wed, 9 Jan 2019 06:16:13 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 43A138E00A4; Wed, 9 Jan 2019 06:16:13 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id DB73A8E0038 for ; Wed, 9 Jan 2019 06:16:12 -0500 (EST) Received: by mail-ed1-f70.google.com with SMTP id t2so2778185edb.22 for ; Wed, 09 Jan 2019 03:16:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:date:from:to :cc:subject:message-id:references:mime-version:content-disposition :in-reply-to:user-agent; bh=hcM/PVGGKLvJ2ChTjdUJ+czIJxqLGTuC8awdCWIcbSk=; b=kkOxgUgqNeysgEAZgC0vyYA5PL6T/FlQPY88OEE0n4DgCBO13CB51p6sazqAgfBDLk ihQxDjL2zJuJPWqQJq90eigo70nWMHZRBOsl8tG63QLktI9AdgX4hyqHxJUkvKxD/2LU 7k+ojnSFiFQkeRYnacf18jzGk2haFlcKVo0+uCYWs4XIkXylIYPKzAaLuoiNWD74lzl9 y6pcoirjl0CO9dY8wosjVVNLC/ur7RkV0jzNWakJGb+5IwwHQbpve8pWBPYFCzngauv+ qyBbPV85yK2d5wwX1m4mmaTAOs0Wq3fQKLCaJK6/pInt/UjtLdp8xBg37chaMUDCb7i+ xpgg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 46.22.139.15 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net X-Gm-Message-State: AJcUukeBozuVl9Z29Vggk9lfs7/tZIBiZO1sw1Z1r3GeG3XkDIsa8n5O yto9Jt7iJsqkvfE7tO+p277/eIXPEzVsVnTsZzYYKDI4z8YuOjUAqffVyXHCyAGZgCj9ZeJHtDh 1LGgTmUE4ALZUYQTF9pycDevlQpwADM3SX6LTxIx4rduKKZiCjDIARwYZErdk9GtdPQ== X-Received: by 2002:a17:906:9154:: with SMTP id y20-v6mr5109595ejw.8.1547032572393; Wed, 09 Jan 2019 03:16:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN4VK7aERMKC887aUG6CXjBmvdPdFl03Zidm6VkMIVH2jSrJt2G/+zOKiKnmMn8yzCTIXQHI X-Received: by 2002:a17:906:9154:: with SMTP id y20-v6mr5109552ejw.8.1547032571389; Wed, 09 Jan 2019 03:16:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547032571; cv=none; d=google.com; s=arc-20160816; b=M7TCvME0BPq9qXxrJ/LWefF9omY+7JFFS6I+ehQmKC7EBEM4JLB4Ots+ii9oZ0v8os 0oyeh5wTEt34wDa1LMC+RojxpzAw6ZoNXBhiV/P2Z0Ee9WU7S+CR+JsZDqJsFlG8s7eU MzbQVy/Oul6jVSuM/1jMp59ABsZenm7IsnJN7d9HslLUj7OoXlwqnRWjKdUT9AJuGfOs 4eHMB5bMswFAG7uxo5fdf5HxGtpz1jF0MBsZxI92yjEqnZ9pKNT3Oe+o4/8icq9j3iR3 2M57kxAuh0PxKSf7quBlNuejBiK3mH0RCfC8Wz2IvUnjo8BoZ1WwB2NFHW8qk4ROBvwb +R0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date; bh=hcM/PVGGKLvJ2ChTjdUJ+czIJxqLGTuC8awdCWIcbSk=; b=TQ5RNyDoJN0sho6c6V6qxjrOOj6BZR5cU/H7Tv7KpQJ3VwlCyeTFgqtZ3WfSODGJUV zC0k2rHKp9aoGMZtbxuaU8C2/NPNMIRLfoxXp5DbC3FY3NUFxKbIVaQHYigvWd4YbzS3 4cER9rq0e5eENGF5wAKXHK667LrpyfsUZR0lJ5K4XmjZUqkuYf+VQLtlkJ7oJI/u0lBT jfVGcBCIpw8mAoJOUJWKcJSN1egZshTLNSSOBp6vvCYQLg1bk0UU4mwTnsKrPzJHvMcS p7wEnWpEXL5HF1iy1AEdR5nMRYv9mUhCdbaMDuYKT7HKDTpNI0PlsYY731mvvnKReq3o jslw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 46.22.139.15 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net Received: from outbound-smtp10.blacknight.com (outbound-smtp10.blacknight.com. [46.22.139.15]) by mx.google.com with ESMTPS id q10si1417106edd.257.2019.01.09.03.16.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jan 2019 03:16:11 -0800 (PST) Received-SPF: pass (google.com: domain of mgorman@techsingularity.net designates 46.22.139.15 as permitted sender) client-ip=46.22.139.15; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mgorman@techsingularity.net designates 46.22.139.15 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp10.blacknight.com (Postfix) with ESMTPS id 1937E1C29E0 for ; Wed, 9 Jan 2019 11:16:11 +0000 (GMT) Received: (qmail 12389 invoked from network); 9 Jan 2019 11:16:11 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[37.228.229.96]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 9 Jan 2019 11:16:10 -0000 Date: Wed, 9 Jan 2019 11:16:09 +0000 From: Mel Gorman To: Andrew Morton Cc: David Rientjes , Andrea Arcangeli , Vlastimil Babka , ying.huang@intel.com, Dan Carpenter , kirill@shutemov.name, Linux-MM , Linux List Kernel Mailing Subject: [PATCH] mm, compaction: Round-robin the order while searching the free lists for a target -fix Message-ID: <20190109111609.GW31517@techsingularity.net> References: <20190104125011.16071-1-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190104125011.16071-1-mgorman@techsingularity.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Dan Carpenter reported the following static checker warning: mm/compaction.c:1252 next_search_order() warn: impossible condition '(cc->search_order < 0) => (0-u16max < 0)' While a negative order never makes sense, the control flow is easier if search_order is signed. This is a fix to the mmotm patch broken-out/mm-compaction-round-robin-the-order-while-searching-the-free-lists-for-a-target.patch Signed-off-by: Mel Gorman --- mm/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/internal.h b/mm/internal.h index d028abd8a8f3..e74dbc257550 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -192,7 +192,7 @@ struct compact_control { unsigned long total_migrate_scanned; unsigned long total_free_scanned; unsigned short fast_search_fail;/* failures to use free list searches */ - unsigned short search_order; /* order to start a fast search at */ + short search_order; /* order to start a fast search at */ const gfp_t gfp_mask; /* gfp mask of a direct compactor */ int order; /* order a direct compactor needs */ int migratetype; /* migratetype of direct compactor */