Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp352754ybt; Mon, 6 Jul 2020 10:54:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweo1so+Y7RSFPG3fcnBL5P8eslsRAhSKzMACXG9BfJbmMIjZ+b1ljN1+a8DwwUYgnjhoux X-Received: by 2002:aa7:dd8e:: with SMTP id g14mr58826396edv.208.1594058044220; Mon, 06 Jul 2020 10:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594058044; cv=none; d=google.com; s=arc-20160816; b=PYQjp2BkWtGn6FsBeM6qnEmDbMwxheFbhdaaCmJ5Vr0kWeqGTAd44toENANSqwyBVv fNuJ0hDU0Gyq8bTOA+tySoSMyJNw87SvRI9jMWE57qMz6DYK84tV1ZMr8OySdacMn+CO rMPRnZl6eFH5Rm/0tlkT340P+4S63+MzwPtv8Q5FG90F93iQ9kYARYIhWYqIls2Xmd45 M5JwJGNxGPCApJVG4I3hxJ57Sx8qYYbc9TfXKbgJfR+HAucKyXE2rsXRxrLS6/bf+L4x Lmr7xskFFn70QnfbfpgcuO14eAGj1iC6dc4hrONERJYDNyrYyMDLI2iK0H3SJsznuGaX b4bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:dkim-signature; bh=yIZDy7/npTujE+1qmA6wlNDx90xTHHdDBj7AS75+Fas=; b=eRFseW4EvBRXf7VtTfDq7n+fbGJ+97RCQD4cXqIw5n6K6CBfbtWSs5/xHbzvcMP7zd umQWw/Eg9g2wJEVsm0SvF5U87TOO4Vq/DXwEgdFd2LscfWlrWr8EDeJmhayahPRR4X47 /KYICaISR0/zK9rahECPPSf5TfeMSuajPogNccC8CV+Rc1gy0aQDlHeX7G3CIYqgP1ra UW0j/73DrVqzePAWwfV5TiMFvvKeXYS7BKcDS1vlBGZJnStNoJK0DbY29yODEauuw/oD hyTtoxZEfPCOcp147qUTB3ZQ/VoKpRLh9i1MfI/GqvOpKvNTOfmLxOIHvxSn2nHiIG6C JhUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TTNRNBPe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qc14si10792249ejb.611.2020.07.06.10.53.41; Mon, 06 Jul 2020 10:54:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TTNRNBPe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729672AbgGFRvK (ORCPT + 99 others); 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