From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751172AbdH0FpI convert rfc822-to-8bit (ORCPT ); Sun, 27 Aug 2017 01:45:08 -0400 Received: from mout.gmx.net ([212.227.15.18]:50265 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750760AbdH0FpH (ORCPT ); Sun, 27 Aug 2017 01:45:07 -0400 Message-ID: <1503812659.7566.43.camel@gmx.de> Subject: Re: [PATCH RFC/RFT] sched/fair: Improve the behavior of sync flag From: Mike Galbraith To: Joel Fernandes , linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Josef Bacik , Juri Lelli , Brendan Jackman , Dietmar Eggemann , Matt Fleming , Rik van Riel , Ingo Molnar Date: Sun, 27 Aug 2017 07:44:19 +0200 In-Reply-To: <20170827010226.19703-1-joelaf@google.com> References: <20170827010226.19703-1-joelaf@google.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 Mime-Version: 1.0 Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K0:pRUK01Ki/mjoyCK4J6OrSUWtlyHoy7VLVjXbRCiM3zmi7qnpq6F zN+WgSR1ZTGZdh+63i1WECKLxCInFRn0iz/49U+n9iK5ISYeSct5BUyS4mgvi7UmM8W8/t5 yy6ZlZUex989Fd6UFT8XDsQzNJqPjWKyq+poE36nmcWScDsBmKr6+gFGDVa7iy0eLJ80gc7 zBIVfUYLBBYPFf2kJIiHg== X-UI-Out-Filterresults: notjunk:1;V01:K0:pr2AMorSqlA=:MpH+tTNMevwh5IGKZHgVk+ pPB5cwyCjw0cVKYzgUTQkJawcDk/YlR3uW8LEGKJFCoMIkOP1TNZKX76RHFig8YNRMxAIWzpo I7SOokUpY6Q7Sq/l41pQbe/lvpw0mPQDlPIA3PjBlqPC0wFP7IewqYyJbjIr8WFlInuDoe5yq HppGsgEmBru+DIhK0QIgITL8nDxqFDrQoHxt8aBP/WIvRj/7xj++u1taaQN2I4wYm0b2fUKzs fUd1TlkvRi8fmZViA25K2weOYh2OaaQ5TPCZ58uJFwh0eU6qauuyZO/hzMR5eKhXhiEJlTX0o If4yyVvRfvaHpSGsQEPdY7860kF+aDtDJXIL2Vhl7NgK6wBXrOuJwLlh2HZGuq/fSaonoRJXY 5PYUSZv99t3forhXrIn+wPa8oYMLJ4CsQMzEaBBB+fPZtDUrMS1PoUHD1LGOcLsV5BO5n8hGu wle6RS0uphr5escOm1IriS4nRXdB5YM0a2UVm9/sBDW/4X/RT445kIAx+lLgCYV4zosnUKBEC hSffK3ynX/lBK+k8kcef+lmw7kEB8qevO5/mrHEatEJKSXp+NR9qhHc+KnzdFp2JRcQpecQS/ AGoIjWKjVn4sxn6aMCBoStOqEQRTMGD4kMAneJZpI4O7gNcELfpZEubOXPHokJpoqgC+MMvNu ZtaYPJez+YZIVlt5Lg6uAAi4xGS9MCujkQ4WLilzSUbCf+ZAhTUzDBfgyKOKYhdR9gbS2zC36 y2pYwly5xEBayj/Sy2gzQeJJcUZEKd6ihZ8PuVD7PyzJLmNLxyST+DL0WeQUz+NdtKzyq4K26 9yd3UgObpjUc+5vAvCd2OkjVUgUPpZQRlrNZV7PZSV5UeptWKQ= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2017-08-26 at 18:02 -0700, Joel Fernandes wrote: > Binder (Android's IPC mechanism) which uses sync wake ups during synchronous > transactions to the scheduler to indicate that the waker is about to sleep > soon. The current wake up path can improved when the sync flag is passed > resulting in higher binder performance. In this patch we more strongly wake up > the wakee on the waker's CPU if sync is passed based on a few other conditions > such as wake_cap, cpus allowed. wake_wide is checked only after the sync flag > check so that it doesn't mess up sync. Binder throughput tests see good > improvement improvement when waking up wakee (calling thread) on the waker's > CPU (called thread) with this flag. Some tests results are below: Sync is not a contract, it's a hint.  If you really want sync behavior, you need to create a contract signed in blood to signal that you really really are passing the baton. Sync wakeups make tons of sense when the waker really really has one and only one wakee, AND really really is going to sleep immediately, with zero overlap that can be converted to throughput by waking to an idle core.  With no L2 misses to slow them down, pass the baton microbenchmarks that do no real work can generate impressive ping-pong numbers... but the real world tends to do more than just bat a byte around endlessly.  The existing hint is not strong enough for your needs, it's current users may overlap with their wakee(s), change their minds about sleeping (be handed more work to do) etc etc. -Mike