Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936277AbcLVD3S (ORCPT ); Wed, 21 Dec 2016 22:29:18 -0500 Received: from mail-bn3nam01on0083.outbound.protection.outlook.com ([104.47.33.83]:14240 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932915AbcLVD3P (ORCPT ); Wed, 21 Dec 2016 22:29:15 -0500 X-Greylist: delayed 4424 seconds by postgrey-1.27 at vger.kernel.org; Wed, 21 Dec 2016 22:29:15 EST Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; mblankhorst.nl; dkim=none (message not signed) header.d=none;mblankhorst.nl; dmarc=permerror action=none header.from=amd.com; Message-ID: <585B3346.2020001@amd.com> Date: Thu, 22 Dec 2016 09:58:30 +0800 From: zhoucm1 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: =?UTF-8?B?Tmljb2xhaSBIw6Robmxl?= , CC: Maarten Lankhorst , =?UTF-8?B?Tmljb2xhaSBIw6Robmxl?= , Peter Zijlstra , , Ingo Molnar Subject: Re: [PATCH v3 03/12] locking/ww_mutex: Extract stamp comparison to __ww_mutex_stamp_after References: <1482346000-9927-1-git-send-email-nhaehnle@gmail.com> <1482346000-9927-4-git-send-email-nhaehnle@gmail.com> In-Reply-To: <1482346000-9927-4-git-send-email-nhaehnle@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.237.74.158] X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(7916002)(39860400002)(39450400003)(39850400002)(39840400002)(39410400002)(2980300002)(428002)(24454002)(199003)(189002)(47776003)(38730400001)(229853002)(65806001)(65956001)(7736002)(33656002)(2950100002)(6666003)(305945005)(86362001)(36756003)(356003)(2870700001)(86152002)(101416001)(4326007)(5001770100001)(189998001)(97736004)(2906002)(68736007)(39060400001)(4001350100001)(77096006)(50986999)(87266999)(76176999)(6116002)(92566002)(3846002)(59896002)(105586002)(64126003)(8676002)(65816999)(23676002)(54356999)(626004)(50466002)(106466001)(83506001)(8936002)(81166006)(81156014)(80316001)(5660300001)(43062003)(3940600001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR12MB1874;H:SATLEXCHOV02.amd.com;FPR:;SPF:None;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM03FT060;1:kCP/hLAqBTqFZYVYZNU7QmBOnUI0QT7Q32NKF7M4q4N8dDZUW443iB4pV1yO6nkxobTR3C1CEtDBHmFex9S9mI+jaUhpdLimLEEhNzLoCh3QNbrvMsfWMrenhtnrZ99E/u+M/WCwGs1Ljt5e8TgDXJkMo4O43SY7Ct2nw2YarALKE/vyBFKbIEJDhN2N+DdiTfwppRTQA5RxTzls28E7vYoWNbwHa2CicfSsbsZ+QZy+8Sel7gwWh26C2iDVbk5T3QlcgYvaj5IDCYrcM9j577wUurOgAlu+qn8k990Enlyox+ezNMiaOXu+cHl1GmAMOFYIcwprtuZLKw3Dr2TceDwNBW+n+FYOQHHKUF+uKGd6Sn3yxdOrjX4ug6ePeJE8PODJPB7wB1fMmtYZTK9KGBvECzVFMHjSXSJcGrCL9ZK1S8Xq1Lx4ezLCf0odViRfPhxQ/OenNrrS3ysuY1oUmUzltvoU2TMtOQjORFtoQxRo9XPKxNLKdrVuZrGh5VLDOo9tLMgDJp6KeBGDPYM5UA== X-MS-Office365-Filtering-Correlation-Id: 803896a0-6c93-4c3d-9c0e-08d42a0e4453 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR12MB1874; X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1874;3:T9OSjS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t5faw94xmcYJa6j40E5aZPYaRWNkaRqmLiZZHh3InIniuJGdXzA40U05x5v5E2LnMpM2XfTWc3TNJ7qw7Hxx3sTg8hJKcbblgOzPliV9FcdIlPu5SVmgOvFRpMylj6P04DwqTd4Pey3cFmOBI2fhX7sbJbAYGmsB2DHJzpXfW667329 X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1874;31:aLwOdRHJ/oINhPnTIw+Mb9Udad+AT210Kye3qlEnpIyIpyNP/iwyekP45wIoAn0Zryzcd7TR9u5w1ZRxXmZn5TgvyftQsjBOvEE9kBfTthPiKEl7kSTN+SvoafDwexC2C02L3ogVjQTOVAS9iBSvGTrHgd9+crcIDCoH76FF9VrlVufaN6sxyxm2sybXiyOJoQY9M0geD5Ujdg4Emx4pPofizfb0au83Ux0c0sx40PXImOa3kuYc7jTX0+EKUqGRh1wYVBBqYzWBnguxMciCQA==;20:TytNws+9WBtr3G/z4K7Yi7ZsBC6UJIffceAH/m+xoMfl7eNxHyZzJ0DYu5la48PnjAGihuDlHkEl9+Mb+WhzeAR7Z8WIYKzqaQYpKw+GwcwYPX3BTTqaHaqjd5m2PHEaDuWoN2n7PinHbScuL2QA4+8itsVhKib7OfNKcR8q1UlWyNLb0+xeSoUB6dGrmhsPt8oARvT9zZt+ZWllbjAosJLBqyUS75dINMRMFr7kccxuM9yebPU7jaXvgGlSmIjajgFzNZOitHuydDEo6ZYofrvahOZAV9AkIhPECbBblhQZjMi/DL2HxaDTdN6Oc75At3DE4WuAHlh31Rr35dM8OuuWmtbEZPcipBbb8dhY6wI+F+aUz3ocBJFHL/c0yILzHduUW1b9AVXesr5SDnxt1uFWEzmP/AtZ1GS3bE5G/mCM59eGwD9knPxhWcKkoQRDDJ6sMvD3iIfLz2Kn4QjC4fpH2x0ZmyQPULwTYhQRprBqc5g19LJMFv9XZysl/dgt X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(13018025)(13016025)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123564025)(20161123558021)(20161123555025)(20161123562025)(6072148);SRVR:BN6PR12MB1874;BCL:0;PCL:0;RULEID:;SRVR:BN6PR12MB1874; X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1874;4:ttW0IvxJJfdUd4+Qr45y8kXyVztAMSGPVGMyYrxrlZlAR0NzPl/PAnQyzvhgi+S8253TZI9QlaCzmlULQl/cTCjdnq/HFZZ0JDDg3fPXBAbF//JZdGP0/bOr+PtQ5vaVc1aAj5LlrLulSElNHWpVxuyPz29D6vml16T0GBeQRX+OXyQ4M0eMdPUgnkdLqf2mXocD3n9eJcY7h7i3UbkJVcxON6P7yqFKbL8QyfmjxwiKWxnV33ff7O76EYNyrOtXV0i56QIehQl0eCx3KYfrqpk6oSPMI0mIKUbRYfPmAXZDn7I4GaMs5uZ5n0fUYL8Te/3ws95vCh2vqkE/fIbnt/N3DT3uN4FRXCfEyYaUdAPzfd1qhEeM7NiDJISurW25ed3ZFmWz2Ac3pkX28zmsUVcKnoy2AtQisq/klA5a7haoiblI8cxnkaxsBnntJPs1cd4dfmmuxxI61AoWGfzT4ZbixqY4FeI/oj3rd7x//gfOvTBG8FuHQb7ZZXrckaQckXEooB13+FLzpH4LLGfxC79xO/QQPdxW+X1exeg7Rndq6p6pB4IT3H558GudQ2qTAs6UPOKIfHJefatljJvS+h4+0FpyUIQfpnjSii3+EGnSTmjDVsdcc7NpD7CY5yiWqe4KgjOFbGjboWLsNm8wndchZEp+QFcA6OqENZ3nLCU= X-Forefront-PRVS: 01644DCF4A X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjEyTUIxODc0OzIzOlNDeXBnYXJjOExuQ2E0WUF1aDZZemI0VkRn?= =?utf-8?B?UVZvY292VW1VMVpENkM3V3hmZk9tT21yVWl3OE9VVDBCYk1scmZvRTJGdXVy?= =?utf-8?B?dGZNV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NMlRLSloxV1hsaFNU?= =?utf-8?B?Rm1SUnM1b0JkNzZMOUlxdUlDK1NKOUFyU1k2RFpVM3FMa1czbWZqV2F5ZjNi?= =?utf-8?Q?Il4DwV?= X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1874;6:cRuSd9oRYorWDpPoWJePk9Xb5tS/PV5gJu3CSG0d9A0jBZcienpAW6VuATgKVmHQndAdu+7Ifd9OszIPG4G1hWR+0Nn74Mh2kYjL+c0E4YOMjiDyJuaZ8rG48H/u6+62tWOIciPZVpNQpav+dooNSS+LxayvEUdQkBbRSyLRoBqEUBAdHZklgV3q6DA7wat4KB/2nwErfMmCJemxlFjx5dxs+4TS1J+UCO8j5c17GhLu1+fImrzkrqlXqSL3fWr1iP7wzf84rEROjBu5MeypE4tT3/0FbyyuFvv3L+Vc39JBoFBYamnC/y7IHoFxH/rD4frDG44xpoLKLIl7L2nELRL59Zr6M+jYaaGGqR8dPL/7dzqNU4rJWz+dt/i3CJvMFW9fm1Lx+VfPnLinY/jY6NYsKhq0hYxma+vjNMHLOs8aF9o3LvIsIqANysxPtGCMxrW1KmJWHVssZ9tHfgd/gQ==;5:KNlgjG5fFf4c3Ioy6gFOYEkaElMMIVnOq7QgzdE5SAUjgL3VOu8Ko+EZophEjc/qhvakPuaORAHuVnpD0qvgBnQCTPtiEGYnNrb+jyyOOKzyprM5datrAz8+ylqQkgGAWglH20EB36AsA/5M8xvCbw==;24:aTUZaLZoJvnhOjcfSjCLMq19MkplUIX9l2q0MmuHoX1jNNcF/5UzTfL4offZMrZ36my9MzUcpmYd0o/uivcvcM3n7QFfYPjhYucdn17fOpU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1874;7:DtLeku87TNFcwgJJtwzUmuqeLQs96eMOyF3t4fJujxbSKvSVCRPFAnNf5Y/ioYH/huLjw4g98J6LDwPDY86o+rSZMaCvb+/RG667QTpqxtIYNtGwwncBDnKlBw5QWTw0DHTUly57GiRovJ6EqXTqNSU1y5xCFPRwnbCCE8jpgHyPArT/FqK8Scot4m1zdabQWKvwpc00mdQ1c2N4FWuhgLbWQAD/fZbWeZOA/8mqXe186p+gIVICuQC58rLOloCAPI91U249axx3QtnfoTD7EBYJJMCcjqVySxaArLfsIdDqP4SML5bGIylqGGltIkBMjIc+5cbYr/+Dc0iYS0Ms0Ts/jj8tEwSIpn/NdVquWiuQYv12dJA++EcCJ+CgX++ZA2bVflMRsm9Soshow0+/C1n6UoeY3xM6+3rgCYAZXPklogJhrKQJm3w6rN22kUDcXiLWpxLWBUFut9HFsBO2pg==;20:bXARdfLezPC0bxyiOpXbJXQJvzZYMIeViWzpGa0gNNIXZvNZT9e9qflZtI7YO6O/w8PLtC6tmXfYWh7HBju+lHeiYLjqFDAHT6zalGwwSvBhU3ql0oMt2WWiJduEpguttuiTyuASiWTHUcFkSj8pRsHRHqHExo/JBJapUKW218h9n97/7HAmyzaxHbIkZ0wD+AySytgrHGex9mbhtHIcQbDgp5LFcjp8uV+2cQTypCP8MKYZpjAB8Xo01kRtLnM5;23:sz1CZk6eveO61c5Azi/iEhcvod59i3SbHeR92YORfnXUnnyfn8nvGlr43ftDC98IDFATLscDkTihgYpDIGu5CfIha4y5UUJP0cH0WZPUl+GLoJ3V+VefHNGpjzq40ycsV6uVi2rlRJyr2Em2H6zdZw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Dec 2016 02:00:12.7040 (UTC) X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1874 X-OriginatorOrg: amd.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 398 Lines: 13 On 2016年12月22日 02:46, Nicolai Hähnle wrote: > +static inline bool __sched > +__ww_ctx_stamp_after(struct ww_acquire_ctx *a, struct ww_acquire_ctx *b) > +{ > + return a->stamp - b->stamp <= LONG_MAX && > + (a->stamp != b->stamp || a > b); I want to ask a stupid question, why a can compare with b? They are pointers of structure. Isn't stamp enough for compare? Thanks, David Zhou