Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp328236lqr; Wed, 5 Jun 2024 07:19:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVNj/5D3GY7IapLE0387ByK5zE78W77YjzTPcrEapcPVrlSeEanF8nC7U/HiZAigibSDsFOlyy59ZMTfhhDb2k7vpgIBXLN161ySqLhpA== X-Google-Smtp-Source: AGHT+IHF10nOH0kHO4aZzYN6FWdIvF5S901SUpyKK8Srxi/0Xt+IuVBEuHGH6VhRLJqkCVvY+HBB X-Received: by 2002:a05:6214:4485:b0:6ae:c9:3f09 with SMTP id 6a1803df08f44-6b02bf875a0mr32824706d6.35.1717597163059; Wed, 05 Jun 2024 07:19:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717597163; cv=pass; d=google.com; s=arc-20160816; b=vI9myNYXIvEDuZLED+J9TMy5L1DPX2FwPmc5C1Molg7ghi90iyOMUz818D6QX8/gpb EnGFPsbCWaG2tAR2K99vqAlsKwbh3OOjrOr0LYuhMN4PLmZapPYncFmmKYTnIE+ebAp8 b310V5Lf9NYjm7LX32CiwVS3nzxIETPSY/Vr9Cw/nMvqt10UnTvDeV32kyfTRVTMfJKk P3wHvg/X4u/8Vn4If6FaZBw7Ugx5rq7WLNH7YunSyPt8+yJs9B/PPe9zhyY3cGtjZfpO J7DCbx/7vp6eOtaxSuSH7pb5Yk3VWKIPwDUOobmSmbqVHFnZuMmO5JqAtzkG1e2omVTJ AjEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=dwI8FIOILkq/9/seZsMfaaMjELj3eDiG4Kw43Y0phXk=; fh=+R7NYsGdpFdHR4Eu/mAiAlfKAXZdiIbSIzwiWMQialY=; b=UOFmUtmp7qcAy3bdL/cebNTEiygHrxXbq5Vz31rk6MwX7NX0Yz5gWb7OHQJrkK2FFl rgBZ9OMyEHscsmD0DoLtqPGEVw59o/5DinZ46AxyvDqttCNBzsej9JZXS391FWywJ6o+ P8yEaabHPkjqFTHw57T7mdmtkmnbgnA4Tv9RN7ZQBn3I16mJs4SwVEdMqPVEDJVVInaY fb2uKRO8iOle5uz6fVBpQrbbgmH6qOcSSfxgBI5hxtEs8gJ0qHcQaO1puVJo4C798iEh WkSNTaGjswMeMQNAfkmGQ+PMK6XQhnA+kvvEh4uvzQtXAPpkxFkfL4wPu+DiEqOPIWz1 yjxw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EKU2cmfz; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-202767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202767-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b42bf4csi135483606d6.506.2024.06.05.07.19.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 07:19:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EKU2cmfz; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-202767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202767-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C6A271C21C38 for ; Wed, 5 Jun 2024 14:19:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03ED61AAA5; Wed, 5 Jun 2024 14:19:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EKU2cmfz" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 B0A1D17BCD for ; Wed, 5 Jun 2024 14:19:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717597156; cv=none; b=Dt6l32YeAQWomfN6X+qlkt3r4kgsw6J2U9rBuXY2Amhk1zjkxTxzRK5n/CTboXJDGA6S9tYvoEZiBEfLdxyovMmhMbcLbObPbHJ530VrvuUjEMfA/ywyHCK5PaJ02VNPFEZuBJFV03TcGEAZmFO3YHL6UMMtsPeOEdfMxtZ3HXI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717597156; c=relaxed/simple; bh=r1W5V48P8us/oKRdqlb5UGa1+dmQCutjwcz0nQAc8oA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pG0odshqEbTWPPIJqYhvHjtSVeboQ9nidr+Lvs1YskHSjCYLDqDGWYXl3FwNVi2QEIAATSL1HZS85fb6lyHV1UfOo8TdSk3n7KlcK3d16g8uC5VXhlfGw5h5bwUR1is+GPGjbLAlMc3G5DS5DlRJ1FPHRAhxnsIxXqelU33NpeA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=EKU2cmfz; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717597153; 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=dwI8FIOILkq/9/seZsMfaaMjELj3eDiG4Kw43Y0phXk=; b=EKU2cmfzPSATZ0bM2r+1GCkbCKBr7B76Rs48cwoSDEpZsy2Y93Q+UguEgEQq3Yv+bFgVR1 CafrElZYdaJWqmuFYlktKfWgQLVv75XUDN6ZLKYdzm6rQfG5l0BkeqLp9ZtucmcAVfU+ZU Dwp0nNupHD0XL3t/aIEc3PgHxFbZsJY= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-620-3AYg_4XUMVuwoKfQnTfmFA-1; Wed, 05 Jun 2024 10:19:10 -0400 X-MC-Unique: 3AYg_4XUMVuwoKfQnTfmFA-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0C17A19541BB; Wed, 5 Jun 2024 14:19:08 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.50]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id A217419560A2; Wed, 5 Jun 2024 14:19:03 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 5 Jun 2024 16:17:38 +0200 (CEST) Date: Wed, 5 Jun 2024 16:17:33 +0200 From: Oleg Nesterov To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Andy Lutomirski , Andrew Morton , Dave Hansen , Peter Zijlstra , Borislav Petkov , "H . Peter Anvin" , Linus Torvalds , Thomas Gleixner , Uros Bizjak Subject: Re: [PATCH 3/3] x86/fpu: Remove init_task FPU state dependencies, add debugging warning Message-ID: <20240605141733.GC25006@redhat.com> References: <20240605083557.2051480-1-mingo@kernel.org> <20240605083557.2051480-4-mingo@kernel.org> 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: <20240605083557.2051480-4-mingo@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 On 06/05, Ingo Molnar wrote: > > But the init task isn't supposed to be using the FPU in any case, Afaics, the same is true for any PF_KTHREAD/USER_WORKER thread? > +#ifdef CONFIG_X86_DEBUG_FPU > +struct fpu *x86_task_fpu(struct task_struct *task) > +{ > + WARN_ON_ONCE(task == &init_task); > + > + return (void *)task + sizeof(*task); > +} So perhaps WARN_ON_ONCE(task->flags & PF_KTHREAD) makes more sense? Although in this case fpu_clone() can't use x86_task_fpu(dst) as I tried to suggest in reply to 2/3. This is offtopic right now, but I am wondering if it makes any sense to make arch_task_struct_size depend on PF_KTHREAD... I mean, create another task_struct_kthread_cachep used by alloc_task_struct_node() if PF_KTHREAD. Oleg.