Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp722504ybg; Tue, 28 Jul 2020 17:49:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwL/5o0K5yB7LePIzhtA9aPea/YIOX22KugCMRlZL7D6mnfiZ6OyqbLxdzjltuhke1p/s/w X-Received: by 2002:a05:6402:204e:: with SMTP id bc14mr29104529edb.128.1595983751687; Tue, 28 Jul 2020 17:49:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595983751; cv=none; d=google.com; s=arc-20160816; b=lFYafDau1MKnhBOIMT89H/rvpux5llUc65gaRkGJdKzo4TCdnj8aUbphkkdWGESLM/ qXNM8VTFxypVG0oBfuZNuc5g0vuBm8Zqq6p+CjknZJPpOnLIFyP/GTFCn7RorlaVmSX2 wTbEQv1CQ8JZlkRk2pNASpKruLHLVe9wB3dnmSohYstM5oUuYGSh9NJ37uPqQv8MqIpN sMaCm54doMaA46sEOAvmVBpxjC4Ne0HsM+jwrXVCLzYw5zpUv2RVEk+ARxsIw+LQLfla TOQ4KdzLAdj16gWHuXZegoap+DxnMVZlDLgtQnkgQNekLOUoyPFBTIbmsVq63YlpT6zK Kwdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=TZpBzS6Mw8FsKaFCjSQrKUgKPJVm8mKmc3zvmdtB9LU=; b=oM9oFYsIfY2T7x0sPO8tdBET2405EZgdJxUNt594FfDz9jIxeGhCIISb3+a2WB2Vpe HqjNhZMj7P5UR2/n731JNBq+bpnQsGctEY8zRglv3wnUmK9eMOYeYa2KfdXZrvKzMn0Q AzabRJu+49aw/upT4nmLv4zLXiZ+HJNkTw/aBX6joD8cO2AggLTOzHzvBkRwhxthYGmq UABVVSxj7N7cjjaGVs8kZ6iRMfWEkjn5EMbKYVL4Z7P6oZWsFovTrrPNc0RZIHNrjJ3K iZOCHLhi5KV6cIOZF/bprN52q1qE1qd4w5mgApppDnwzFj/I5wxbYinPBDgLgcfdQax4 lFHg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a90si228656edf.486.2020.07.28.17.48.49; Tue, 28 Jul 2020 17:49:11 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730935AbgG2AsU (ORCPT + 99 others); Tue, 28 Jul 2020 20:48:20 -0400 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]:36814 "EHLO out30-131.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730837AbgG2AsT (ORCPT ); Tue, 28 Jul 2020 20:48:19 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R711e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04427;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0U45v0Du_1595983694; Received: from IT-FVFX43SYHV2H.lan(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0U45v0Du_1595983694) by smtp.aliyun-inc.com(127.0.0.1); Wed, 29 Jul 2020 08:48:14 +0800 Subject: Re: [PATCH v17 17/21] mm/lru: replace pgdat lru_lock with lruvec lock To: Alexander Duyck Cc: Andrew Morton , Mel Gorman , Tejun Heo , Hugh Dickins , Konstantin Khlebnikov , Daniel Jordan , Yang Shi , Matthew Wilcox , Johannes Weiner , kbuild test robot , linux-mm , LKML , cgroups@vger.kernel.org, Shakeel Butt , Joonsoo Kim , Wei Yang , "Kirill A. Shutemov" , Rong Chen , Michal Hocko , Vladimir Davydov References: <1595681998-19193-1-git-send-email-alex.shi@linux.alibaba.com> <1595681998-19193-18-git-send-email-alex.shi@linux.alibaba.com> <1fd45e69-3a50-aae8-bcc4-47d891a5e263@linux.alibaba.com> From: Alex Shi Message-ID: Date: Wed, 29 Jul 2020 08:48:00 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2020/7/28 下午11:55, Alexander Duyck 写道: >> /* >> @@ -511,11 +511,11 @@ static bool compact_lock_irqsave(spinlock_t *lock, unsigned long *flags, >> * scheduled) >> */ >> static bool compact_unlock_should_abort(spinlock_t *lock, >> - unsigned long flags, bool *locked, struct compact_control *cc) >> + unsigned long flags, void **locked, struct compact_control *cc) > Instead of passing both a void pointer and the lock why not just pass > the pointer to the lock pointer? You could combine lock and locked > into a single argument and save yourself some extra effort. > the passed locked pointer could be rewrite in the func, that is unacceptable if it is a lock which could be used other place. And it is alreay dangerous to NULL a local pointer. In fact, I perfer the orignal verion, not so smart but rebust enough for future changes, right? Thanks Alex >> { >> if (*locked) { >> spin_unlock_irqrestore(lock, flags); >> - *locked = false; >> + *locked = NULL; >> } >> >> if (fatal_signal_pending(current)) {