Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3884491rdh; Tue, 28 Nov 2023 06:29:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IF9krFlBcOMBr/TbQe3N27H6Dt3oxXM3sGianjYD8KPlnzD8aSkzGCBrRDL7gOmU6Hz7+si X-Received: by 2002:a17:90a:46:b0:285:d975:7249 with SMTP id 6-20020a17090a004600b00285d9757249mr5704668pjb.19.1701181752031; Tue, 28 Nov 2023 06:29:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701181752; cv=none; d=google.com; s=arc-20160816; b=ihfbHoSldxC5dvCdcoa9cflPyB0nZFQvCJnh1/07ubb/EkF9lrlx2mg6Vp6Fl7IzUt JMONZu00fDUMmSxo+ouC9ayxpDo6vd8klIrilHRSq4hQOe3NsDSgWzkUQ+JfcrrIeJO7 B7QA25cw71FCDaGePMGvktWgnThu3wQvC9YPP3OSWTHqvE6LkI/h0zqqu66slJwEbzvj vLb+3gABLGI1gboKxQg51BTBOAEf8nbsI6lfO9kid1fFxw+xCX06YRLxyvJn6/NhKprB UZ+23jPtcjcfbiU6f2RucFERdfuRO6JRPPFQM/vRVmiFJZ2J49yBz1j6wBZzLeSBulH1 O+Zg== 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; bh=4pQckaFlqfp0zrS1mVbaIPvfdeNDPTuAmiAq2Hl5Pio=; fh=kOSFhAZysTpNV05s41JhBueJwKVutHJj+nrp1AEtbTM=; b=wMlxk73tGcJbDJSfeP8eJ6Ni9BSje002ECdPkK46GmgHSuobhWjJkQtP3Gjm9IwgTa E6EjOgMvqjG1SloHiJED4P14zWeb2Tb+u+ZoZC40A0Cg+AX7dVAnlyV4fUEmsVfX8+l7 NZM2gHB1kxDRD6kLW+GQpOAYKJj7uZv9QbHbIq3c4kMPi4X8r7ACpWxDmmhGxyclUaH7 M6Byo/4aP588wZR7vOsL6upMmQwLhyzfFMUfpAk8+wv7i6epS2RMEyQj0i2H1IVl/d+7 JU/3vxSZGTJS8gNzAvBreQWg3aRGsLnfTGQ8LQbxlcxSwvWr2oHPV8vRp4Bh0h0TVQDU OUZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id s13-20020a170902b18d00b001cc3473657bsi11889926plr.215.2023.11.28.06.29.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 06:29:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 6FF858054B53; Tue, 28 Nov 2023 06:29:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346155AbjK1O2x (ORCPT + 99 others); Tue, 28 Nov 2023 09:28:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345705AbjK1O2w (ORCPT ); Tue, 28 Nov 2023 09:28:52 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EB9718D; Tue, 28 Nov 2023 06:28:58 -0800 (PST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D179521995; Tue, 28 Nov 2023 14:28:56 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 9F5D313763; Tue, 28 Nov 2023 14:28:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id OByqIij5ZWW3PQAAD6G6ig (envelope-from ); Tue, 28 Nov 2023 14:28:56 +0000 Date: Tue, 28 Nov 2023 15:28:55 +0100 From: Michal Hocko To: Gregory Price Cc: linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, arnd@arndb.de, tglx@linutronix.de, luto@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, tj@kernel.org, ying.huang@intel.com, Gregory Price Subject: Re: [RFC PATCH 02/11] mm/mempolicy: swap cond reference counting logic in do_get_mempolicy Message-ID: References: <20231122211200.31620-1-gregory.price@memverge.com> <20231122211200.31620-3-gregory.price@memverge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Bar: +++++++++++++++ X-Spam-Score: 15.00 X-Rspamd-Server: rspamd1 Authentication-Results: smtp-out1.suse.de; dkim=none; spf=fail (smtp-out1.suse.de: domain of mhocko@suse.com does not designate 2a07:de40:b281:104:10:150:64:97 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=suse.com (policy=quarantine) X-Rspamd-Queue-Id: D179521995 X-Spamd-Result: default: False [15.00 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_FAIL(1.00)[-all]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.82)[-0.820]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_POLICY_QUARANTINE(1.50)[suse.com : No valid SPF, No valid DKIM,quarantine]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[]; NEURAL_HAM_SHORT(-0.18)[-0.923]; RCPT_COUNT_TWELVE(0.00)[19]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(2.20)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[41.14%] X-Spam: Yes X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 28 Nov 2023 06:29:09 -0800 (PST) [restoring the CC list, I supect you didn't want this to be a private discussion] On Tue 28-11-23 09:10:18, Gregory Price wrote: > On Tue, Nov 28, 2023 at 03:07:10PM +0100, Michal Hocko wrote: > > On Wed 22-11-23 16:11:51, Gregory Price wrote: > > [...] > > > @@ -982,11 +991,11 @@ static long do_get_mempolicy(int *policy, nodemask_t *nmask, > > > } > > > > > > out: > > > - mpol_cond_put(pol); > > > + mpol_put(pol); > > > if (vma) > > > mmap_read_unlock(mm); > > > if (pol_refcount) > > > - mpol_put(pol_refcount); > > > + mpol_cond_put(pol_refcount); > > > > Maybe I am just misreading the patch but pol_refcount should be always > > NULL with this patch > > > > earlier: > > + pol = pol_refcount = __get_vma_policy(vma, addr, &ilx); > > i can split this into two lines if preferred. > > If addr is not set, then yes pol_refcount is always null. My bad, missed that. Making that two lines would be easier to read but nothing I would insist on of course. -- Michal Hocko SUSE Labs