Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756212AbcCCHwX (ORCPT ); Thu, 3 Mar 2016 02:52:23 -0500 Received: from mail-db3on0078.outbound.protection.outlook.com ([157.55.234.78]:19317 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753711AbcCCHwT (ORCPT ); Thu, 3 Mar 2016 02:52:19 -0500 Authentication-Results: spf=pass (sender IP is 193.47.165.134) smtp.mailfrom=mellanox.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=mellanox.com; Subject: Re: [PATCHv9 1/3] rdmacg: Added rdma cgroup controller To: Parav Pandit , Tejun Heo References: <1456859137-13646-1-git-send-email-pandit.parav@gmail.com> <1456859137-13646-2-git-send-email-pandit.parav@gmail.com> <20160302173949.GG29826@mtj.duckdns.org> CC: , , , , , Johannes Weiner , Doug Ledford , Liran Liss , "Hefty, Sean" , Jason Gunthorpe , Jonathan Corbet , , , Or Gerlitz , Matan Barak , , , , Yishai Hadas From: Haggai Eran Message-ID: <56D7ED17.30800@mellanox.com> Date: Thu, 3 Mar 2016 09:51:51 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.0.52.254] X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;AM1FFO11OLC012;1:Oo1LDaBId9oWXUg6N5ziUJUXAMH0OseUlQ4hgUFfBGGHXayMw7qu768PzJaugQbYrAcqyC/ZVs/8dY0Jm01H+eZAgNAdyc/64fX5DpaoA4f9M5xSTJyTFH6vhYDmYfJFarv4DEULvW7b7uBXyIS1WpG8UMSAznDBoGciSBr29wZaJQvLwtt/Jk6j5PvycsTyAuYqYbqdphSQyIdKg3mggPh/HgNr2WOvBV3A7i3Bn87YToPm8EK7BWQd9bCe76yCkiKoagEccbXxHmaz1ejRor6ncGxGwD3pm2RUt3AnYPqmKOOLChYlahl4KL5FION8+KRxF0Tr234cqJAYjhZQoM31wKpoImZQOHu7lR7QsI/arFMf+5ux174eX+k2tRmqjC/eHEsB7yzSYgijfcDzO6sA5tBfOoG9m1wVVOXqBAjP7BYgfKbT5QruJVHsnUjf+0HizXBu3AUxMTn818JmEA== X-Forefront-Antispam-Report: CIP:193.47.165.134;CTRY:IL;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(24454002)(377454003)(479174004)(189002)(199003)(19580405001)(19580395003)(83506001)(11100500001)(23676002)(86362001)(92566002)(2950100001)(65956001)(77096005)(64126003)(106466001)(47776003)(50466002)(93886004)(87936001)(1096002)(1220700001)(4326007)(65806001)(3846002)(586003)(6116002)(33656002)(230700001)(107886002)(50986999)(54356999)(189998001)(76176999)(65816999)(36756003)(5001960100004)(2906002)(4001350100001)(5008740100001)(5001770100001)(5004730100002)(6806005)(3940600001);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR05MB1451;H:mtlcas13.mtl.com;FPR:;SPF:Pass;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB1451;2:GL4QHJucjz6dyAdUNAtqpizNIKfz9Y+Tra0jTx2qyVR2Fuw+id3lAxk8+aoIZfHwUj0ph1TyokKCI+GGLvyYj1hJw0hYqrduOIyTkhDeldPDYAz7EMUWB3JuSnon1ybSO2oF4Tr0n2myepq92hQ3KQ==;3:+o5i5XG1m1KCRhBKZPiB1HUEvNrkj1iHl9J9q6+pgbOzdLGNepX0aGZtwBblx00B5E2pvHYG5PDq0lE8DgzUhj0XSPbWsoALmHJrDWwpZIp3I10NmnkmwnF92qWiOxGwhuowZIgAJ2Q3kewITGbqmwvWgdxL1bEl/NHfiwWPXzGlfAmbp57jnQBPR43g3bWd3ifIHqdRgWFWMSZYGu4DWZA4eYtjgGEEvZ88Qw42RBF9b0yhf57GhisU9rSeAys4s7XJ513pjYDnKXLjliWZFA==;25:lRaGGJ9a1A/nvZFb9/GzH2eyNvCsfuSqj4Ez7FWWIQNA+nyrQYDKTsdey1jRBHTAzq7SpLVanh9DlY6fbtf4e/XehVg89m7pW2R1K5eLsc7vK/7mDpaQj0T1FQTsxSOxmi+Dwcx4Qk+7XmMT5yFRbFrEA6ulVDMkZqV8xzr0gMepxhavZrGzkRyQOGVKFSPM3nER3KGvSUEKVYhGJu62+QoDXmLOJMdFQv+T3wY5DB1HgbxIhE5cim4nCcH5L5sdI+s6e7nFAVBjS1dTqIK914HZHKY8C0zWPZl5GRie0+k0ip+IKnuoECETvB2Fx5OEC5H3QrzY4VR2nYDmh75QGg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501001);SRVR:HE1PR05MB1451; X-MS-Office365-Filtering-Correlation-Id: 4610a81c-1e25-4d53-914f-08d34338bae3 X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB1451;20:DKWVwSOWBYt7FRU9m7kaytFmrNuBDGWHGng0NZzarrjLkemq4RUgzysdq0skg/VVXpX/aM1jy0XxT7wHo1I2RKys8sGp/AZ/33kdw3A6twvVX0FxaqpopvDFWkAxflsYf3uqIgK74UO+evcHFGY5HKg79S4nnWQ5KSemF9Il/Zy+MztplBDQozT0BtLUveaa4bl/V3p4SqCYvWh1JXiguS5lNiC+KlnKvqhpbYhEordGsI0Sh8R/qYhvuehdkDT78oUyCExvmCjYKlNAKCz6BsY/DeREm75Rijy+llcR0lcXR0kUJfFYeVIynegREyKTTIKzusCEqhqGWn5G+DDm2A80toHGnvorXD6uEnWl8CZiudf7Jc5SN6Bq1mQX/Ek9nKJQOebmoWTQ4aoVh6gdWgy2PZt1EUXwKCAtCopFvFlcSm99GD/NGlJTKjaZEj5ImrGVIZmko/RMzjn1X/Awc9PYAImOsqfWEJ0iwVRKfjdkUGwdCdUbsRopKbBRs/H3 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(13018025)(13017025)(13015025)(13024025)(13023025)(8121501046)(3002001)(10201501046);SRVR:HE1PR05MB1451;BCL:0;PCL:0;RULEID:;SRVR:HE1PR05MB1451; X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB1451;4:bC4i6WCYWx91iqEDzN9/O/8HGNxEUiiEg6vvtPc2/Lxq3bqYM9DqyRS9HzL71MJSiuo9d6eiK6aU7XoEhBpxJ8vtuCcv3tqvKvvKDqCmOo3Rm7rTJrCDVEdY0Iwf4jL+dCt2alM97p0vejfVRBigBASWJ7tM9uI8ax/iR7oHohPbZOo0g1Zbw5yTzSGZskQ2dgDu5EvwOxy4zENMbKBAIbpUY+kK82XLTMModHCiQOkFbj802fwCb7Wg8qUKl38qbfq6xlCc1CYXKD6ipYxh2qHFApjZdoRa4iKapYT3EHPRO4zQZGk2BQikW2NExn2zKv3cRX411YENygp03+cKy4RDkVc77cwyiE68ZE3lTEOCPk0oJzSmurEmPjbXM8DcqBFP5/qaRP9378SieumAb6RaHWzsXJe+X5H0CnR2khz28DU30uZsI+tak+gC6Lh7n7JPqxh+h27wXeYnqeKewQ== X-Forefront-PRVS: 0870212862 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjA1TUIxNDUxOzIzOjNTNFJUcW9GTjNmY0NwRDB0Y0FkaEsveDVU?= =?utf-8?B?RmNNeXAzRC9USkMyalBlNGwxZFlidkZsSENKbFBleDRIUHdkVDQvY3c3cXlM?= =?utf-8?B?bHdneHdUSDIxTkdPem96NDU1OFFsN2Nnd1ROdUtjNDJNWFplRmR0YmcvVkNk?= =?utf-8?B?eW0rd3g3cG55UktQcVlMMzd2a2E2aUNZZ1RheGFkUlVGWnhzT3FFZ05wMlo5?= =?utf-8?B?WUE5LzU2emFnRnJhSXRONlVGVG9ocHdFNWQxeUQ5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049 (UTC) X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a652971c-7d2e-4d9b-a6a4-d149256f461b;Ip=[193.47.165.134];Helo=[mtlcas13.mtl.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB1451 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1474 Lines: 36 On 03/03/2016 04:49, Parav Pandit wrote: > Hi Tejun, Haggai, > > On Thu, Mar 3, 2016 at 1:28 AM, Parav Pandit wrote: >>>> + rpool->refcnt--; >>>> + if (rpool->refcnt == 0 && rpool->num_max_cnt == pool_info->table_len) { >>> >>> If the caller charges 2 and then uncharges 1 two times, the refcnt >>> underflows? Why not just track how many usages are zero? >>> >> This is certainly must fix bug. Changed refcnt to usage_sum and changed to do >> usage_sum -= num during uncharging >> and >> usage_sum += num during charing. > > This is not sufficient as css_get() and put are done only once per > call, which leads to similar problem as of refcnt. Are css_get_many() and css_put_many() relevant here? > As I think more, I realised that this particular test is missing that > resulted in this related bug, I realize that we don't have use case to > have "num" field from the IB stack side. > For bulk free IB stack will have to keep track of different or same > rdmacg returned values to call uncharge() with right number of > resources, all of that complexity just doesn't make sense and not > required. > So as first step to further simplify this, I am removing "num" input > field from charge and uncharge API. IIRC there are no instances in the RDMA subsystem today where userspace allocates more than one resource at a time. Yishai, in your proposed RSS patchset did you have a verb to allocate multiple work queues at once? Haggai