From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752772AbcHNRKD (ORCPT ); Sun, 14 Aug 2016 13:10:03 -0400 Received: from mail.efficios.com ([78.47.125.74]:46646 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751862AbcHNRKB (ORCPT ); Sun, 14 Aug 2016 13:10:01 -0400 Date: Sun, 14 Aug 2016 17:09:58 +0000 (UTC) From: Mathieu Desnoyers To: Dave Watson Cc: Andrew Morton , Russell King , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , linux-kernel , linux-api , Paul Turner , Andrew Hunter , Peter Zijlstra , Andy Lutomirski , Andi Kleen , Chris Lameter , Ben Maurer , rostedt , "Paul E. McKenney" , Josh Triplett , Linus Torvalds , Catalin Marinas , Will Deacon , Michael Kerrisk , Boqun Feng Message-ID: <670118488.9908.1471194598001.JavaMail.zimbra@efficios.com> In-Reply-To: References: <1469135662-31512-1-git-send-email-mathieu.desnoyers@efficios.com> <1469135662-31512-8-git-send-email-mathieu.desnoyers@efficios.com> <1590181502.79032.1469329777708.JavaMail.zimbra@efficios.com> <374861479.8581.1470957990793.JavaMail.zimbra@efficios.com> <753387169.9345.1471030573282.JavaMail.zimbra@efficios.com> Subject: Re: [RFC PATCH v7 7/7] Restartable sequences: self-tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [78.47.125.74] X-Mailer: Zimbra 8.7.0_GA_1659 (ZimbraWebClient - FF45 (Linux)/8.7.0_GA_1659) Thread-Topic: Restartable sequences: self-tests Thread-Index: AQHR45U4x18RQTQYYkqrz+QZ0tH6dqAmgBWtqVs2wOHWpixZPK3gbMn6QVQW3bnQMu7EG6sJtige Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Aug 12, 2016, at 4:05 PM, Dave Watson davejwatson@fb.com wrote: >>>>> Would pairing one rseq_start with two rseq_finish do the trick >>>>> there ? >>>> >>>> Yes, two rseq_finish works, as long as the extra rseq management overhead >>>> is not substantial. >>> >>> I've added a commit implementing rseq_finish2() in my rseq volatile >>> dev branch. You can fetch it at: >>> >>> https://github.com/compudj/linux-percpu-dev/tree/rseq-fallback >>> >>> I also have a separate test and benchmark tree in addition to the >>> kernel selftests here: >>> >>> https://github.com/compudj/rseq-test >>> >>> I named the first write a "speculative" write, and the second write >>> the "final" write. >>> >>> Would you like to extend the test cases to cover your intended use-case ? >>> >> >>Hi Dave! >> >>I just pushed a rseq_finish2() test in my rseq-fallback branch. It implements >>a per-cpu buffer holding pointers, and pushes/pops items to/from it. >> >>To use it: >> >>cd tools/testing/selftests/rseq >>./param_test -T b >> >>(see -h for advanced usage) >> >>Let me know if I got it right! > FYI, I have started implementing rseq_finish_memcpy() and rseq_finish_memcpy_release(). The idea is to perform an inline memcpy as speculative writes before the final store (offset). I have pushed the work in progress in my dev branch. This would be an alternative to rseq_finish2() (which I still consider very useful) in cases where we want to push a sequence of bytes into a ring buffer before updating the offset counter, without having to rely on memory allocation. Feedback is welcome! Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com