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=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 9DE1AC433DF for ; Mon, 6 Jul 2020 17:51:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8293C20702 for ; Mon, 6 Jul 2020 17:51:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TTNRNBPe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729689AbgGFRvK (ORCPT ); Mon, 6 Jul 2020 13:51:10 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:55646 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729568AbgGFRvJ (ORCPT ); Mon, 6 Jul 2020 13:51:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594057868; 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=yIZDy7/npTujE+1qmA6wlNDx90xTHHdDBj7AS75+Fas=; b=TTNRNBPevuLTidVyYQ4rYQyb4TaanmywQDx9lG5cwmJSSuFKdwkXGx9R0EIUF5ZLHcvVst 2K2bozs0P3Vvy5e8GAiVPasCLv5aHb0/q6+7kk0MJ9vNDDORupbnmWhjW/ZXWjO7oFp3dq qC74PjWDNyfhpOk3O8kVok7e94X/DxI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-302-x4PEWjVBOVCAbFwNXlw4ig-1; Mon, 06 Jul 2020 13:51:05 -0400 X-MC-Unique: x4PEWjVBOVCAbFwNXlw4ig-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 057EC100CC84; Mon, 6 Jul 2020 17:51:02 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-112-118.ams2.redhat.com [10.36.112.118]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AC753B3A7E; Mon, 6 Jul 2020 17:50:55 +0000 (UTC) From: Florian Weimer To: Mathieu Desnoyers Cc: carlos , Joseph Myers , Szabolcs Nagy , libc-alpha , Thomas Gleixner , Ben Maurer , Peter Zijlstra , Paul , Boqun Feng , Will Deacon , Paul Turner , linux-kernel , linux-api Subject: Re: [PATCH 2/3] Linux: Use rseq in sched_getcpu if available (v9) References: <20200629190036.26982-1-mathieu.desnoyers@efficios.com> <20200629190036.26982-3-mathieu.desnoyers@efficios.com> <877dvg4ud4.fsf@oldenburg2.str.redhat.com> <942999672.22574.1594046978937.JavaMail.zimbra@efficios.com> <1679448037.22891.1594056826859.JavaMail.zimbra@efficios.com> Date: Mon, 06 Jul 2020 19:50:54 +0200 In-Reply-To: <1679448037.22891.1594056826859.JavaMail.zimbra@efficios.com> (Mathieu Desnoyers's message of "Mon, 6 Jul 2020 13:33:46 -0400 (EDT)") Message-ID: <87k0zg3535.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Mathieu Desnoyers: > Now we need to discuss how we introduce that fix in a way that will > allow user-space to trust the __rseq_abi.cpu_id field's content. I don't think that's necessary. We can mention it in the glibc distribution notes on the wiki. > The usual approach to kernel bug fixing is typically to push the fix, > mark it for stable kernels, and expect everyone to pick up the > fixes. I wonder how comfortable glibc would be to replace its > sched_getcpu implementation with a broken-until-fixed kernel rseq > implementation without any mechanism in place to know whether it can > trust the value of the cpu_id field. I am extremely reluctant to do > so. We have already had similar regressions in sched_getcpu, and we didn't put anything into glibc to deal with those. Just queue the fix for the stable kernels. I expect that all distributions track stable kernel branches in some way, so just put into the kernel commit message that this commit is needed for a working sched_getcpu in glibc 2.32 and later. Once the upstream fix is in Linus' tree, I'm going to file a request to backport the fix into the Red Hat Enterprise Linux 8. Thanks for finding the root cause so quickly, Florian