Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp718400pxb; Wed, 27 Oct 2021 11:00:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzs2H910wpfleyn3/uhzHSVEqx1q13mYUKMwFM38RHF+aRWEWmy3TT/ao79weX7d4yMe3fA X-Received: by 2002:aa7:db93:: with SMTP id u19mr10753320edt.179.1635357646322; Wed, 27 Oct 2021 11:00:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635357646; cv=none; d=google.com; s=arc-20160816; b=S76gGaAF+lrweJqVBR6AQbxLeDKG1JEto6dq/UG8CQmTbG2wGKnvcJl+DctLJBGDql UpAVDZQzsl4xqAdHy6ycziu2m+NeFvGSGbDdnY4Qae2nw9ciXLUh4x9OZSVkfnhG4VA6 esyPqP6hiCr06+8bJTEoCeqsYXLICMRRcXK1ZMhWJ4AlSu6pBMmrFA/KTNdApFTSMyld FSHwhgJ6AMusmItnHQHBl91qSzPFtaMPOx5KRhMl0m9abpDS6ujXXQXbYe8s+3mmu9FF JDphfZoo3y+cBANutiPwI7U0pVwtFq37rSYnKdSLEOCkHTY9m3Ft8ObOZ2fnmcCEqrJC aihA== 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 :dkim-signature; bh=eYetLBlAcojUYZGAtj4Ll7PYw0ihUehplkOn+pQk5fc=; b=VofPUySuZWbjSfWxMaKlJ7gHl4M9DW1UjIM9yoJORiY7VMShL7vKZDrDBaP/id6uFO oi18zIbdEGN62Xk2wgaBh9aLIBjRYoKUdoVXO2qp1n8ivm9tFC3cGBtBbSCIxTn0exxF eP/ROhotkGuj0o5Yb1AAzd9uuSUWDNpXfBEIXFU5Fuj+2r2qeJhmkjKCi8pTdzJUi32m PkstoBFEVKk7kBKGREtJa/Cf/zRRkaccxj1kxPuWWqk3tAS3uBp2l2ck0O2zo4mqr15L wBGbT4fLTZFbZ09e0Gabr/np0p3bcKVwsvVDT/xil/JuOO536F9A8zW3DiWR5YxtZhVo SuPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=swdqjHjY; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si764942edb.152.2021.10.27.10.59.53; Wed, 27 Oct 2021 11:00:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=swdqjHjY; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238201AbhJ0Fyn (ORCPT + 99 others); Wed, 27 Oct 2021 01:54:43 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:51288 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236625AbhJ0Fym (ORCPT ); Wed, 27 Oct 2021 01:54:42 -0400 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 DEDA61FD4A; Wed, 27 Oct 2021 05:52:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1635313936; 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=eYetLBlAcojUYZGAtj4Ll7PYw0ihUehplkOn+pQk5fc=; b=swdqjHjYrEFfj86WvsqxVcWvw+ioDZFBJ7EV0euU5G1mrIpIlxmfjTj4ht6sndtLQLptFU rkEu+ZmOXM5O7BNVDt//B8nj79qjSH5rf96Y2da0C7ZheP+88pyIQZ6VNTiRD80K9gwIxg 0AKo9uvODwqOK/Bg1nOle5quATMEfqs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1635313936; 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=eYetLBlAcojUYZGAtj4Ll7PYw0ihUehplkOn+pQk5fc=; b=RIl8BhaNn++LlFjZld6LWwAiEqkOWUR/wXzVAID0U8YP1x2WZ+n8mleOJhxi9+iw6/t8M2 J0ibryUAR6vb9zDg== 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 728A513E6D; Wed, 27 Oct 2021 05:52:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id BycVGRDpeGEnTgAAMHmgww (envelope-from ); Wed, 27 Oct 2021 05:52:16 +0000 Date: Wed, 27 Oct 2021 07:52:14 +0200 From: Oscar Salvador To: Mike Kravetz Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Matthew Wilcox , Muchun Song , Andrew Morton , Pasha Tatashin Subject: Re: [PATCH] hugetlb: remove unnecessary set_page_count in prep_compound_gigantic_page Message-ID: References: <20211026220635.35187-1-mike.kravetz@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211026220635.35187-1-mike.kravetz@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 26, 2021 at 03:06:35PM -0700, Mike Kravetz wrote: > In commit 7118fc2906e29 ("hugetlb: address ref count racing in > prep_compound_gigantic_page"), page_ref_freeze is used to atomically > zero the ref count of tail pages iff they are 1. The unconditional > call to set_page_count(0) was left in the code. This call is after > page_ref_freeze so it is really a noop. > > Remove redundant and unnecessary set_page_count call. > > Fixes: 7118fc2906e29 ("hugetlb: address ref count racing in prep_compound_gigantic_page") > Suggested-by: Pasha Tatashin > Signed-off-by: Mike Kravetz Reviewed-by: Oscar Salvador > --- > mm/hugetlb.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index 906fe8a3b93d..88047a367080 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -1795,7 +1795,6 @@ static bool __prep_compound_gigantic_page(struct page *page, unsigned int order, > } else { > VM_BUG_ON_PAGE(page_count(p), p); > } > - set_page_count(p, 0); > set_compound_head(p, page); > } > atomic_set(compound_mapcount_ptr(page), -1); > -- > 2.31.1 > > -- Oscar Salvador SUSE Labs