From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45518C32753 for ; Wed, 14 Aug 2019 16:40:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 23A8E2084F for ; Wed, 14 Aug 2019 16:40:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728116AbfHNQkd (ORCPT ); Wed, 14 Aug 2019 12:40:33 -0400 Received: from foss.arm.com ([217.140.110.172]:57184 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726166AbfHNQkc (ORCPT ); Wed, 14 Aug 2019 12:40:32 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 30B23344; Wed, 14 Aug 2019 09:40:32 -0700 (PDT) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 805FA3F694; Wed, 14 Aug 2019 09:40:30 -0700 (PDT) Date: Wed, 14 Aug 2019 17:40:28 +0100 From: Catalin Marinas To: Mark Rutland Cc: linux-kernel@vger.kernel.org, ak@linux.intel.com, akpm@linux-foundation.org, bigeasy@linutronix.de, bp@suse.de, davem@davemloft.net, hch@lst.de, kan.liang@intel.com, mingo@kernel.org, peterz@infradead.org, riel@surriel.com, will@kernel.org Subject: Re: [PATCH 5/9] arm64: correctly check for ktrheads Message-ID: <20190814164028.GC54611@arrakis.emea.arm.com> References: <20190814104131.20190-1-mark.rutland@arm.com> <20190814104131.20190-6-mark.rutland@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190814104131.20190-6-mark.rutland@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 14, 2019 at 11:41:27AM +0100, Mark Rutland wrote: > Since commit: > > 6eb6c80187c55b7f ("arm64: kernel thread don't need to save fpsimd context.") > > ... we skip saving the fpsimd state for kernel threads in > arch_dup_task_struct(). We determine whether current is a kthread by > looking at current->mm. > > In general, a non-NULL current->mm doesn't imply that current is a > kthread, as kthreads can install an mm via use_mm(), and so it's > preferable to use is_kthread() to determine whether a thread is a > kthread. > > For consistency, let's use is_kthread() here. > > Signed-off-by: Mark Rutland > Cc: Catalin Marinas > Cc: Ingo Molnar > Cc: Peter Zijlstra > Cc: Will Deacon Acked-by: Catalin Marinas