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 56BAB3D413C for ; Mon, 25 May 2026 08:27:22 +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=1779697643; cv=none; b=qC0JZ7MYAgjYQP6M9Q4E/z47RuWyJ0dGcaJ+5w1KFZso1gTRwCN13A3+xceDmydtSwhBcLoYHoZqIDG9gviCVoPb9YCAONhimBVpz7ZwDiHz4c8Lnl32FUENchpHOETSr7aJ6R8Rido++Io22gKHU4BMLpz+dGtgu8JtLsTkPb0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779697643; c=relaxed/simple; bh=p5tTqxhz2qWkxmH2+1kmJYMDtzNzC5ILOvUTf3aMJWU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=acUkXQ9hJf20tDtguYhD/2AGtvK1Mdyx4e/Sq+wQ/ipFL5zK0XdAZfdcRvF24/OYluJIbChymC7+DkOEDxhq2Aj0NtB85zVeG9oKqjSNfvSP5xRgZPyl33hjz6bjiVzJHkWzjQTrOSz5S8tpn97tRnWzYNce7zh/9tt99oLY9UI= 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=TFs8Nsnh; 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="TFs8Nsnh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779697641; 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=KtamHNuFR28E7fsEP+29LCwcwgDE+8M+BYluFb5uW9M=; b=TFs8NsnhLtnzuvmn6EdryBiUb8AHkp3hx4+IFuyjhu20w7pYmDIaHsPhfxVs+TXM+sMwWh NPqCidThXzP9QedZ5+zUbxbpdTtZrBPzLKDKHH3+ySp5J+lo7LjOmC9Fljj2c7Ps65UQyi 5vS+AoHDPc643NPWIt4NBoLE7MqvJ+U= Received: from mx-prod-mc-06.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-383-AzJYTmhCNY-eMGQKXHADpA-1; Mon, 25 May 2026 04:27:15 -0400 X-MC-Unique: AzJYTmhCNY-eMGQKXHADpA-1 X-Mimecast-MFC-AGG-ID: AzJYTmhCNY-eMGQKXHADpA_1779697633 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E1AC51800578; Mon, 25 May 2026 08:27:12 +0000 (UTC) Received: from fedora (unknown [10.44.48.14]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id D807C1681; Mon, 25 May 2026 08:27:07 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 25 May 2026 10:27:12 +0200 (CEST) Date: Mon, 25 May 2026 10:27:06 +0200 From: Oleg Nesterov To: Gregory Price Cc: Alistair Popple , Andrew Morton , Byungchul Park , David Hildenbrand , Joshua Hahn , Matthew Brost , Rakie Kim , Ying Huang , Zi Yan , Jann Horn , Kees Cook , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] mm/mempolicy: kernel_migrate_pages: simplify the usage of put_task_struct() Message-ID: References: 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: X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 On 05/24, Gregory Price wrote: > > On Sun, May 24, 2026 at 06:57:59PM +0200, Oleg Nesterov wrote: > > > > mm = get_task_mm(task); > > - put_task_struct(task); > > - > > Hm, I was a little trigger-happy on that review, I just realized that > this increases the scope in which there is a task reference held (i.e. > we're now holding a reference across do_migrate_pages()) > > I don't *think* that's an issue, but it might we worth looking at the > changelog to see if this was done intentionally. I did this to simplify the code and the next changes. We pin this task's memory across do_migrate_pages(), so I think that delaying put_task_struct() doesn't add too much. But of course, this is not necessary, I can rework if you don't like it. Thanks for review! Oleg.