Received: by 10.192.165.148 with SMTP id m20csp566355imm; Fri, 4 May 2018 15:19:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqk+osXbNXDmRSzT82xu6GXhJ4sdWx1E/9kOx6IJ9H0RH3lA+2uzeEtNT+qQQTR2mkjeLP7 X-Received: by 2002:a63:7b47:: with SMTP id k7-v6mr23782441pgn.321.1525472382104; Fri, 04 May 2018 15:19:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525472382; cv=none; d=google.com; s=arc-20160816; b=ZrFes97cs6U7lM5i3u/nyd7Xy55yxg6q1bpQ8RlAuYfD9NN3qdBc76SZZQ9hQJN9XI k0Q3Cm8iC+rbSjfTkWxuSLNaIwy1UV4JUZnEheEH/Hb0hvtLPeMuRxc5pEPBmZRavuF7 H9DC0aA0Sz+nz8CB+mndJU116LtJkPVpq6biGzDQWab+cyuIuQLl8nttCjYsXdJFsxTu IzaUXpwPVZaMTB0YQVECEJ33QsObWpMZixR5uAm/f6FgIWAk7Il8oWvfCBT+icGw8k+m NE0BouVOBHIHRWvDS1Yun8EONT1BfDZk4vc1uUw7NsbKBXGzrF9EeKuRsE81W6xUjFHx /eLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature:dkim-signature :arc-authentication-results; bh=y23JfNuJHxycztSxwgB0/niOmvyILWFytUmdKl9uAmQ=; b=UckLia8PvudOxejkf18Leoc5qArle59OZmG68oz1YBfa4CuVOuvOO+JDVkG+erDSBE H0wyqBVknRqbfo1sgDDK2iwmeeVO6NxP1l9L2H2SXwIb1Ss9DO27jFB2bY677FEFU/IW Jl/mNJvwzE+ID17RKBIL9Jc/GcN9dZtfHRzN1u+TLZbvHv3Uu1ypwmvzPllZ8kUVTcjQ aazJpNH1u0+XQ+bxDj5pKmUQxk9LvFVbAS6bVIVptoAOOPruGqapPwcHSbFKFrAHQmov LWQ+GoH8rw7NDsto9FNN5KFu52t9mJZjzSL6vrkGqy/xpYOC9t4VIG8kmMujYcza/Ln2 jZkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=ZI9tuh/d; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=bdtd/89t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11-v6si16410824pll.15.2018.05.04.15.19.28; Fri, 04 May 2018 15:19:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=ZI9tuh/d; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=bdtd/89t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751819AbeEDWTO (ORCPT + 99 others); Fri, 4 May 2018 18:19:14 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:38516 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751611AbeEDWTM (ORCPT ); Fri, 4 May 2018 18:19:12 -0400 Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w44MI01s020380; Fri, 4 May 2018 15:18:00 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=facebook; bh=y23JfNuJHxycztSxwgB0/niOmvyILWFytUmdKl9uAmQ=; b=ZI9tuh/dg1AYpg7B05A3am+16poRr2yYQTyzgMsbLa5n3wHENLoGX7GXcodXaikR6NjB th+HIYJ0fZ3I9n79C0T42Sd4m3tyxclaDxkbchOxLnX/tvwGxXKjTe9Kz1BX3F8Zgqel xlFIYol9nmThs5WXQIn2b9sOeVO7BC8lq8c= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2hrv3b0r69-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 04 May 2018 15:17:59 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.11) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 4 May 2018 15:17:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=y23JfNuJHxycztSxwgB0/niOmvyILWFytUmdKl9uAmQ=; b=bdtd/89tBTJT2EsIftkAzdWHKvWR9JhzuXkzqVVvp/8jvyWeM8ZWtpDuUvYlREwsjI3paoFgu0QoKfj2f6a6tInMaF8QUGKUpeWJN8MM81msAJo8vK1rhBxZI0hdh/07/iGgVotKDToR+QW+KpocHcxtA6o0aTxFCrIy+5NZQkM= Received: from BL0PR1501MB2067.namprd15.prod.outlook.com (52.132.21.153) by BL0PR1501MB2163.namprd15.prod.outlook.com (52.132.22.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.20; Fri, 4 May 2018 22:17:39 +0000 Received: from BL0PR1501MB2067.namprd15.prod.outlook.com ([fe80::84c9:cec3:5b9d:f6eb]) by BL0PR1501MB2067.namprd15.prod.outlook.com ([fe80::84c9:cec3:5b9d:f6eb%13]) with mapi id 15.20.0735.016; Fri, 4 May 2018 22:17:39 +0000 From: Ben Maurer To: Joel Fernandes , Daniel Colascione CC: Mathieu Desnoyers , Peter Zijlstra , Paul McKenney , "Boqun Feng" , Andy Lutomirski , "Dave Watson" , LKML , "linux-api@vger.kernel.org" , Paul Turner , Andrew Morton , "linux@arm.linux.org.uk" , Thomas Gleixner , Ingo Molnar , "hpa@zytor.com" , Andrew Hunter , "andi@firstfloor.org" , "cl@linux.com" , Steven Rostedt , Josh Triplett , "torvalds@linux-foundation.org" , "Catalin Marinas" , Will Deacon , "mtk.manpages@gmail.com" , "longman@redhat.com" Subject: Re: [RFC PATCH for 4.18 00/14] Restartable Sequences Thread-Topic: [RFC PATCH for 4.18 00/14] Restartable Sequences Thread-Index: AQHT4NTlyEPvZnNLQUycRSVAXgFaHKQb0K6AgADLxwCAAAFOAIABk5qAgAAKDYCAAAiQAIAAB8+AgAHZX6A= Date: Fri, 4 May 2018 22:17:38 +0000 Message-ID: References: <20180430224433.17407-1-mathieu.desnoyers@efficios.com> <660904075.9201.1525276988842.JavaMail.zimbra@efficios.com> <1718748931.10084.1525363941807.JavaMail.zimbra@efficios.com> , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2620:10d:c090:180::1:6354] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BL0PR1501MB2163;7:37KJJqPDQywiKH0jlFmFPL+uI+r5/xOE8gfsSnxL/rrQefKPiQdrnvIEkzcpsqDhm1N8HfVKV6KdOL3PUzpfRUaSMN1iErHT+H8IkHL1PL9l05pkQL6h3PvzqhhhvhCrS3gjgUIuLdoPS/gPKrVG5nQGsYwdTXQ8lB7w+7asjLI7H3dMmBqARUm/2/4ygNJZ1SUQwf8At6Ba5ci2dADAsSMdtSyYwnW1yF14vQG98pjZMrsIpgXPY6870e0ob+OO;20:yjj25hEVCkijRWvwEkXreCB3GxSrPfUX6rqq/nWrnjPv4XO/408hxvogGMAjIDNTk+eCgtdDh9KnRC1W/jn0YI4x+3OMFCJxmE8+sQaWkji+CoMR/Zz6xu0KIPhvpqQ6/Eqf00w6WYMMsPa20Yf12tXMQXPLXr+hlNhVgyNMrls= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:BL0PR1501MB2163; x-ms-traffictypediagnostic: BL0PR1501MB2163: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231254)(11241501184)(944501410)(52105095)(6041310)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:BL0PR1501MB2163;BCL:0;PCL:0;RULEID:;SRVR:BL0PR1501MB2163; x-forefront-prvs: 06628F7CA4 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39860400002)(39380400002)(346002)(366004)(376002)(199004)(189003)(93886005)(46003)(97736004)(5250100002)(33656002)(9686003)(229853002)(53936002)(86362001)(81166006)(81156014)(2906002)(3280700002)(305945005)(8676002)(6116002)(6436002)(3660700001)(316002)(6246003)(74316002)(8936002)(7736002)(7416002)(54906003)(39060400002)(6506007)(110136005)(76176011)(7696005)(59450400001)(68736007)(2900100001)(4326008)(6346003)(5660300001)(446003)(25786009)(186003)(14454004)(476003)(102836004)(478600001)(99286004)(486006)(106356001)(55016002)(11346002)(105586002)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR1501MB2163;H:BL0PR1501MB2067.namprd15.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: fb.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: zLkdwqQQZM7WGdt/5/bffcncEn1pTCUvbDx1JerA0J1C7hVzkFpo7j5670hY3CepiWwxvwRjmHKCNOGrhuwdUq4AJANGlBI8LZzJe0BzxGED+AsTMW9X6kv9fZBwhXQeKTFYFV7+JKuf/vKm5vbYddR66Fqos8QpOUCm2En1OxxT1mIHJZ/ZhJNSPYeoOSkk spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 0344dcfd-b213-403c-3772-08d5b20cd8ed X-MS-Exchange-CrossTenant-Network-Message-Id: 0344dcfd-b213-403c-3772-08d5b20cd8ed X-MS-Exchange-CrossTenant-originalarrivaltime: 04 May 2018 22:17:38.9538 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR1501MB2163 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-04_08:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey - I think the ideas Daniel brings up here are interesting -- specifically the= notion that a thread could set a "pre-sleep wish" to signal it's sleeping.= As this conversation shows I think there's a fair bit of depth to that. Fo= r example, the FUTEX_LOCK is an alternative approach. Another idea might be= using the "currently running cpu" area of rseq to tell if the process in q= uestion was sleeping (assuming that the kernel would be modified to set thi= s to -1 every time a process was unscheduled) The idea discussed here seems orthogonal to the core thesis of rseq. I'm wo= ndering if we can focus on getting rseq in, maybe with a eye for making sur= e this use case could be handled long term. My sense is that this is possib= le. We could use the flags setting in the per-thread rseq area, or maybe ex= tend the meaning of the structure rseq_cs points to to signal that there wa= s information about how to signal the sleeping of the current process. It s= eems to me this would be a natural way to add the functionality Daniel talk= s about if desired in the future. Daniel - do you think there's anything we should do in the patch set today = that would make it easier to implement your idea in the future without expa= nding the scope of the patch today. i.e. is there anything else we need to = do to lay the framework for your idea. I'd really love to see us get this patch in. There's a whole host of primit= ives this unlocks (more efficient RCU, better malloc implementations, fast = reader-writer locks). I'm sure we'll have more ideas about APIs to provide = once we've explored these use cases, but to me this patch is the MVP we nee= d to ship to get that feedback. It's a solid framework that we can build up= on, eg with the "opv" syscall or the idea in this thread if user feedback s= hows those things are necessary. -b=