From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751392AbdAPIPc (ORCPT ); Mon, 16 Jan 2017 03:15:32 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50309 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750855AbdAPIPD (ORCPT ); Mon, 16 Jan 2017 03:15:03 -0500 Subject: Re: [PATCH] mm, page_alloc: don't check cpuset allowed twice in fast-path To: Michal Hocko , Vlastimil Babka References: <20170106081805.26132-1-vbabka@suse.cz> <20170106104048.GB5561@dhcp22.suse.cz> Cc: Andrew Morton , Mel Gorman , linux-kernel@vger.kernel.org, linux-mm@kvack.org From: Anshuman Khandual Date: Mon, 16 Jan 2017 13:44:52 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170106104048.GB5561@dhcp22.suse.cz> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17011608-0008-0000-0000-000000FD2D15 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17011608-0009-0000-0000-000008E239D4 Message-Id: <733b937d-009a-e8fb-2257-2bb59314cd03@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-16_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701160126 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/06/2017 04:10 PM, Michal Hocko wrote: > On Fri 06-01-17 09:18:05, Vlastimil Babka wrote: >> Since commit 682a3385e773 ("mm, page_alloc: inline the fast path of the >> zonelist iterator") we replace a NULL nodemask with cpuset_current_mems_allowed >> in the fast path, so that get_page_from_freelist() filters nodes allowed by the >> cpuset via for_next_zone_zonelist_nodemask(). In that case it's pointless to >> also check __cpuset_zone_allowed(), which we can avoid by not using >> ALLOC_CPUSET in that scenario. > > OK, this seems to be really worth it as most allocations go via > __alloc_pages so we can save __cpuset_zone_allowed in the fast path. > > I was about to object how fragile this might be wrt. other ALLOC_CPUSET > checks but then I've realized this is only for the hotpath as the > slowpath goes through gfp_to_alloc_flags() which sets it back on. > > Maybe all that could be added to the changelog? Agreed, all these should be added into the change log as the effect of cpuset based nodemask during fast path and slow path is little bit confusing. > >> Signed-off-by: Vlastimil Babka > > Acked-by: Michal Hocko Reviewed-by: Anshuman Khandual