Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp802321imm; Fri, 31 Aug 2018 13:47:03 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdaui/UgdMRui4a2N9NoWCcKci4zCdVIt/zEpFQ/bkZczQ5B0ghiV6VZUPiLM7FH1/89+RRs X-Received: by 2002:a17:902:2e83:: with SMTP id r3-v6mr17178498plb.80.1535748422938; Fri, 31 Aug 2018 13:47:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535748422; cv=none; d=google.com; s=arc-20160816; b=crzAvpPbmhM4d0BdgDo7y8HX99E/UR8AalrYLVJzuZRAicudHzqjUIvuw5UNDOPAwd PM9UPI27JprYf2Xsor4S1eX/TXV8dVl0ksMEJWdj6TRXENMZdG/Xy+1gdTvaZMcjF5tJ W+PNZdJ4T7MxxZXWRTDEKb0WwOOP9Cu/+eWhTN5xRYznFmu+aam9XE4hWKP7CLoWbjWe vvjJv5y6qIXenW5k3yXVsy+AHUSuQoooVj/6MnNpZzoN7ZDSSsRCJ0Dro2YCvzN2kdpL WLm5qP79GVFUigfHKvH9xtzBcMmCJ2/MTd8iWIASznOc1UVQUMyCs5PzHqVcMu2RwLgj TqHA== 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:arc-authentication-results; bh=LjIpWjS+ISYtZ6DKNmf7IFHatd0ydPnTvHxFhRdBC/o=; b=WrJ5BRwMZ0kEFU3eLU/E/4d0w24bL5vYT8OFOEDSvXBs6U4WwSwsQpBZt7L7cgVPJF PKFf9FxibgK22XPM0zCvznj1XDjpq/Dq1lbVgwJloqCMt8OCirAIIw584ifo2e43RXwp 7uvkXbTp4zeD8H4mNRUagHFaesRTAluenDP/XT96i0kZuQypHFXwGkTmWrTW3ttLmyld hV4mFgHIjGti0xWikhDUCjsjr2S7wKjRdz3HnKDJK3hakwaKJVmi8hJvQWXtbHPhs0Cr zu05XaXD5DbXJpDiL0p7egj9cTUj9cxUyQdpOgSIGh4wnrr3y62PGkzCnUqfMEL7vtkb Xohw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11-v6si6438167plo.91.2018.08.31.13.46.48; Fri, 31 Aug 2018 13:47:02 -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; 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 S1727612AbeIAAy5 (ORCPT + 99 others); Fri, 31 Aug 2018 20:54:57 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46637 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726869AbeIAAy5 (ORCPT ); Fri, 31 Aug 2018 20:54:57 -0400 Received: by mail-wr1-f68.google.com with SMTP id a108-v6so12286918wrc.13 for ; Fri, 31 Aug 2018 13:45:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=LjIpWjS+ISYtZ6DKNmf7IFHatd0ydPnTvHxFhRdBC/o=; b=eBDz+qYp96P8a9w+LM37jtIteGXkKAtCWgF025Dam3dgo3LELEm1tazzDl48nzOIRI QlVNtTdnSZkxsiG33H8mH/haclb2S6QzCQ9Df1MW7444mTtN9XDL4ppX0/CerI6mDK0a wZQN9b1dMi8T7wn8EQNwUmF+DdQEBbs7HiKh6GSWZ/qa5dmGbDf1ko4KNxrdHWQW9UpO gkhUBbqxttMFg48RTI8tF2nhYszHKdbs/+A/3SuqNpQWXLiXLLM7mUjiBm3an9kOzsYE +y5PU2EQ0jMb+SLFShTi0YLVVZ0+SX3Wf3OMzuLLZ3+2oTmtjMSA5fyFGXIB9Ae3eCvt nX+A== X-Gm-Message-State: APzg51DIoawvDOy0MUoN5O2WLKyGSyXUepBblUAQo2B0VY2K8L/Of/cB G70iKQWcbCuhOQnHidJmlLM= X-Received: by 2002:adf:a644:: with SMTP id k62-v6mr11844091wrc.78.1535748344984; Fri, 31 Aug 2018 13:45:44 -0700 (PDT) Received: from techadventures.net (techadventures.net. [62.201.165.239]) by smtp.gmail.com with ESMTPSA id 60-v6sm12822257wre.82.2018.08.31.13.45.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 13:45:44 -0700 (PDT) Received: by techadventures.net (Postfix, from userid 1000) id 62B92124D49; Fri, 31 Aug 2018 22:45:43 +0200 (CEST) Date: Fri, 31 Aug 2018 22:45:43 +0200 From: Oscar Salvador To: Pasha Tatashin Cc: "akpm@linux-foundation.org" , "mhocko@suse.com" , "vbabka@suse.cz" , "sfr@canb.auug.org.au" , "iamjoonsoo.kim@lge.com" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Oscar Salvador Subject: Re: [PATCH] mm/page_alloc: Clean up check_for_memory Message-ID: <20180831204543.GA3885@techadventures.net> References: <20180828210158.4617-1-osalvador@techadventures.net> <332d9ea1-cdd0-6bb6-8e83-28af25096637@microsoft.com> <20180831122401.GA2123@techadventures.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 31, 2018 at 02:04:59PM +0000, Pasha Tatashin wrote: > Are you saying the code that is in mainline is broken? Because we set > node_set_state(nid, N_NORMAL_MEMORY); even on node with N_HIGH_MEMORY: > > 6826 if (N_NORMAL_MEMORY != N_HIGH_MEMORY && > 6827 zone_type <= ZONE_NORMAL) > 6828 node_set_state(nid, N_NORMAL_MEMORY); Yes, and that is fine. Although the curent code is subtle for the reasons I expplained in the changelog. What I am saying is that the code you suggested would not work because your code either sets N_NORMAL_MEMORY or N_HIGH_MEMORY and then breaks the loop. That is wrong because when we are on a CONFIG_HIGHMEM system, it can happen that we have a node with both types, so we have to set both types of memory. N_HIGH_MEMORY, and N_NORMAL_MEMORY if the zone is <= ZONE_NORMAL. Thanks -- Oscar Salvador SUSE L3