From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C9365A0ABE for ; Tue, 8 Sep 2026 17:12:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788887543; cv=none; b=Iz/K3r15sQ9KhHmFxZuRAMW8jthhjOL9HHLTOvpe+97vAAMqfvA11vnPGKOLNFyZn/DNKzJghLQAlx3+orEqTSrzg7x0gBUOu/jTTOFSBNmK2rFWkkueEtmmeOEwGzAiAkDqnK3zs8DKw6J/A6YzXZjrm96LRJALha0DizP+t8M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788887543; c=relaxed/simple; bh=bFfiyDhMTYsXIaRarWFmIgSETkJcz5MnYRCF8sjGN0U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ROA6RWHf1LKiulitvtO3g7oEoLLHz1KedJ+MWUBglF+e4v3pWvYhqPHQKTV3AHt1vYUc1br70cAp5oV6QlBbIIFCp0PvYaIbptQxOFeRjKNmzVTzWgK6gSp17fgUzlnOu6QwIz0qjeU/c+ZiR86ZpwhRe6TK/+Hi1IMNVgloRvM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=N4KNOiwb; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="N4KNOiwb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788887540; h=from:from:reply-to:subject:subject: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=cr9AELuw5H9idpdwLdrYmWGJ6ZfMYkalViYQFkg2pyc=; b=N4KNOiwbIU9uSalhkmqrduuuJE69V46P9/IeAACUn6mIuz5gKZ70oK9q5ig0095+Ktmx0A M77HYyYmfzL9zJHs/oAJ+Ivu4iPxP/b7ndenfEQ3J1YcldfjcjCU9qvZuq+pjxuEOkUXXy jzM5ijWxIvg3m6SYm2u4eNEflL+R7JM= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-633-7ZKgDR04MVW0vhCxiJOlZQ-1; Tue, 08 Sep 2026 13:12:16 -0400 X-MC-Unique: 7ZKgDR04MVW0vhCxiJOlZQ-1 X-Mimecast-MFC-AGG-ID: 7ZKgDR04MVW0vhCxiJOlZQ_1788887534 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 813B6184B382; Tue, 8 Sep 2026 17:12:13 +0000 (UTC) Received: from fedora (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 9081930001A2; Tue, 8 Sep 2026 17:12:08 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 8 Sep 2026 19:12:13 +0200 (CEST) Date: Tue, 8 Sep 2026 19:12:07 +0200 From: Oleg Nesterov To: Alexey Dobriyan Cc: Ye Liu , Tony Luck , Reinette Chatre , x86@kernel.org, Christian Brauner , Andrew Morton , Jann Horn , "David Hildenbrand (arm)" , "Mike Rapoport (Microsoft)" , Lorenzo Stoakes , Ye Liu , Dave Martin , James Morse , Babu Moger , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 6/8] fs: convert process/thread iterators to for_each_*_rcu Message-ID: References: <20260904083001.553587-1-ye.liu@linux.dev> <20260904083001.553587-7-ye.liu@linux.dev> <662ade9d-d662-4f6f-869f-08c41da53170@p183> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <662ade9d-d662-4f6f-869f-08c41da53170@p183> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 On 09/08, Alexey Dobriyan wrote: > > On Fri, Sep 04, 2026 at 04:29:58PM +0800, Ye Liu wrote: > > --- a/fs/proc/base.c > > +++ b/fs/proc/base.c > > @@ -1160,8 +1160,7 @@ static int __set_oom_adj(struct file *file, int oom_adj, bool legacy) > > if (mm) { > > struct task_struct *p; > > > > - rcu_read_lock(); > > - for_each_process(p) { > > + for_each_process_rcu(p) { > > if (same_thread_group(task, p)) > > continue; > > > > @@ -1177,7 +1176,6 @@ static int __set_oom_adj(struct file *file, int oom_adj, bool legacy) > > } > > task_unlock(p); > > } > > - rcu_read_unlock(); > > mmdrop(mm); > > } > > err_unlock: > > What's going on here? > Now it's RCU unlock after mmdrop(). Confused... Why do you think so? I think mmdrop() is called after rcu_read_unlock(), with or without this change. No? Oleg.