Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp699221lqp; Wed, 12 Jun 2024 13:32:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVBO7FP1G3vQ8L9Og71pZ56/6ETUMAxMUJTVTlxiHjpNzvpJSOa48co1yzGMJ6TyzAtneD34ylDxS99c9iVrGZx9MmrLtIs4HQi4ycd9g== X-Google-Smtp-Source: AGHT+IGdTAUMdMDowjwNUwD9A/fpiA10g0HjrFyyh9/MP8YcokUwlmrWu7g8YIplHw+9Km69O06O X-Received: by 2002:a05:6512:3045:b0:52c:812b:6e72 with SMTP id 2adb3069b0e04-52c9a3b8eedmr2327141e87.1.1718224367582; Wed, 12 Jun 2024 13:32:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718224367; cv=pass; d=google.com; s=arc-20160816; b=vmmoiCJh+p5NW9k98d5iSDHxcnsTPKp8Dtj0tXMAJ6uAXXkGzF80hHuId5eEQJzi/o Gps5bUzlx9Vg6ORpEuWUiLFJbyrtiXHMt7D11C7fXRuu64ktkNgXvKV1NMzRIWxamltR zXn5uFRQo1HL9Tzhopo6odGU7PfIwTvWk9mGpXobyQDNoUfhU8CngJ5hrWqCR3pqbdwe aK78YU6XuIJOr2lsM6ySh8L4wG7cTo1U0dcFzWtp63sbXp/cJuh2uVUnFpZrRWYHMXEN rve2NyQfsYJA078h012PEwfsFn4QESGvX6nSfYlnCj+UTE3RUTHXEMr+mpj4IbexHGYG wv7A== 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=oBcfmifnqAR8qklw82vumrXeiUswj4bsQ8QdOVoBb0Q=; fh=i2KluTXb2i4Ks/BulgFim5fjxhCD2ysR8lneBGTVmTU=; b=OPkudSQ7nvae3gZaFu3LhLaeGEtz3Q9jKGyzel8oSBJe/lxahZi/8Ohslvq+fw8Vo6 Y3J7pDP5RLo1EUtgD/i7NL3NyKDVkRKCHvZE9if1MnW0+f7HBvcLq45kn2z1NQiV968p 5eJqYLTqyEErsNJzQv69UFsu7JCzj0KFcRE52uPlcJ7kWhhzL8GuZfYZM6PG8fxsTgjz 0VOqaOFookx2znt7j1volXMWHJ8nkm0dFtIq+GJrVf3Fkn+qIAym0A1Lu5YbeOYczKPJ 7ASsmnUKCKkiwbZisgjyAnGYSVhoyZs/Mn6R9ouOGO4RBpePyLauXYlOhQ2kJdLGKxA0 e/rw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="N+TE1hq/"; 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-212226-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212226-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f0783d276si470649566b.42.2024.06.12.13.32.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 13:32:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212226-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="N+TE1hq/"; 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-212226-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212226-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4CEF81F24546 for ; Wed, 12 Jun 2024 20:32:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D1FE84D0E; Wed, 12 Jun 2024 20:32:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="N+TE1hq/" 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 E437552F62 for ; Wed, 12 Jun 2024 20:32:37 +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=1718224359; cv=none; b=m6kduk2cJ1SPrl0qTbf8EZqZvScE1eX2cj0zOaJB/h31JS4tE5Ii4kPTsx6IZppRQv2/WNQHckXTPKyMKMS0uYvPZByS1kRC4qybQ/PJbdEe6/HYSdtdr2hWlNUywpCrhMMWEeIN2zB0cyGeWQM/XPaORd4h+BBp6ofLgd0Lkvo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718224359; c=relaxed/simple; bh=9IdeTemBZcFn+eza7Th10FBeF3X9Au3MQePWWBpoZag=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jcmepg1m0V39ttyQZP7ChASR0xodgumi9AF1DZjzgFDyMsM5L8sN50Q5q41H4NPinqSImk4f+Vno0sjnVa9f7+eHCn9am2vCtTmNhwmwWCtjm0v9ix3T2ZwiRfvFsxvTVPyhSp79ARrGrMiN0KvTv20qtfJ0LOBhh1YIEPUb9N0= 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=N+TE1hq/; arc=none smtp.client-ip=170.10.129.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=1718224356; 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=oBcfmifnqAR8qklw82vumrXeiUswj4bsQ8QdOVoBb0Q=; b=N+TE1hq/L+orj+QKI0uVowniF3utfZYwu7RR3SIerJh4dgtQSuJNTG2XeYKZDhxKSv81Ft oiB30XWuqLe9EZBwCtIsXwBQekR9NF6adDaxjB2OOOIE73P/mKKe2yoT0FkVLHejQbaU47 3HyPQuLXQkPiucttNrj42jpWeNleoxs= Received: from mx-prod-mc-05.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-115-B0wM7vaTMkapof3mOeCSmw-1; Wed, 12 Jun 2024 16:32:32 -0400 X-MC-Unique: B0wM7vaTMkapof3mOeCSmw-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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ACE8C1956080; Wed, 12 Jun 2024 20:32:29 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.225.215]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 6E0DE19560AB; Wed, 12 Jun 2024 20:32:24 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 12 Jun 2024 22:30:58 +0200 (CEST) Date: Wed, 12 Jun 2024 22:30:52 +0200 From: Oleg Nesterov To: Ingo Molnar Cc: Nathan Chancellor , linux-kernel@vger.kernel.org, Andy Lutomirski , Andrew Morton , Dave Hansen , Peter Zijlstra , Borislav Petkov , Brian Gerst , "H . Peter Anvin" , Linus Torvalds , Thomas Gleixner , Uros Bizjak Subject: Re: [PATCH 3/9] x86/fpu: Make task_struct::thread constant size Message-ID: <20240612203052.GC23973@redhat.com> References: <20240608073134.264210-1-mingo@kernel.org> <20240608073134.264210-4-mingo@kernel.org> <20240610211350.GA1613053@thelio-3990X> <20240611124145.GA26798@redhat.com> <20240612184148.GB23973@redhat.com> 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: <20240612184148.GB23973@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Damn, sorry for the additional spam, but if I was not clear... On 06/12, Oleg Nesterov wrote: > > The patch below seems to fix the problem. Of course I am not trying to propose this change. This is just the debugging patch. Which can hopefully explain the problem. > Again, the changes in fpu__init_system_early_generic() are not > strictly needed to fix it, but I believe make sense anyway. ... > static void __init fpu__init_system_early_generic(void) > { > - int this_cpu = smp_processor_id(); > - > fpstate_reset(&x86_init_fpu); > current->thread.fpu = &x86_init_fpu; > - per_cpu(fpu_fpregs_owner_ctx, this_cpu) = &x86_init_fpu; > - x86_init_fpu.last_cpu = this_cpu; > + set_thread_flag(TIF_NEED_FPU_LOAD); > + x86_init_fpu.last_cpu = -1; Yes, in particular set_thread_flag(TIF_NEED_FPU_LOAD). And x86_init_fpu should die after the next patch. Oleg.