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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 7EA1AC4320A for ; Thu, 29 Jul 2021 15:44:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3B7F460F42 for ; Thu, 29 Jul 2021 15:44:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3B7F460F42 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GkotI3pGPKgvgak16pA7Pq8Vud6fENhqf4Aevb585DM=; b=wjeHxB4GhBpsWt COX+8+lL1KKw5zQqZUCznhz9n/TcnnYFuPqbfa580Mc6ZQP6WFWToNJs8tuTMbnmOKBEcahorCNpt ti+D+412JzxyCu4hi5mxN32Hp5aUDHFFOJzNWXcNPapBfOyibgQCF00o9JVl+SJv5qUFlfGI5njp2 QA0PjibwYRkRrZhMvvEKFkjJ/OS3t2a1Y330OGuDl76geho3D6x1NVlSPNcK1TQ2ohHT/Eu4rLtxh MHFFwlUKCfJKrJ1Nq6AmbkQObmNxcoJOzTsAagAlcjpDnGsfk80mWLcdY98wUAYXUR8Yp+LjALk3s TZu+EiwQyb+67xL/8YXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m98AV-004mRO-QO; Thu, 29 Jul 2021 15:41:57 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m987n-004lfM-Ic for linux-arm-kernel@lists.infradead.org; Thu, 29 Jul 2021 15:39:10 +0000 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 C66766D; Thu, 29 Jul 2021 08:39:05 -0700 (PDT) Received: from arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DEE6E3F73D; Thu, 29 Jul 2021 08:39:04 -0700 (PDT) Date: Thu, 29 Jul 2021 16:37:44 +0100 From: Dave Martin To: Sebastian Andrzej Siewior Cc: Mark Brown , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Thomas Gleixner Subject: Re: [PATCH] arm64/sve: Delay freeing memory in fpsimd_flush_thread() Message-ID: <20210729153743.GO1724@arm.com> References: <20210729105215.2222338-1-bigeasy@linutronix.de> <20210729105215.2222338-2-bigeasy@linutronix.de> <20210729142616.GO4670@sirena.org.uk> <20210729143904.ict3st7whd6ct7nj@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210729143904.ict3st7whd6ct7nj@linutronix.de> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210729_083907_810036_B8D2CBF7 X-CRM114-Status: GOOD ( 15.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jul 29, 2021 at 04:39:04PM +0200, Sebastian Andrzej Siewior wrote: > On 2021-07-29 15:26:16 [+0100], Mark Brown wrote: > > On Thu, Jul 29, 2021 at 12:52:14PM +0200, Sebastian Andrzej Siewior wrote: > > > > > +static void *sve_free_atomic(struct task_struct *task) > > > +{ > > > + void *sve_state = task->thread.sve_state; > > > + > > > + WARN_ON(test_tsk_thread_flag(task, TIF_SVE)); > > > + > > > + task->thread.sve_state = NULL; > > > + return sve_state; > > > +} > > > > This has exactly one caller - why not just inline it there? It'd > > probably make it easier to follow what's going on. > > In case someone makes changes to the non-atomic version which should > also happen here. But I can inline it. Not critical, but you could drop a /* defer kfree() while in atomic context */ or similar in the code just to make it absolutely clear why sve_state is temporarily stashed rather than just being freed immediately. The whole function would be small enough that it's probably still reasonably obvious even without the comment, though. Cheers ---Dave _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel