From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD512C433EF for ; Mon, 3 Jan 2022 15:04:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 236466B0071; Mon, 3 Jan 2022 10:04:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E3BF6B0073; Mon, 3 Jan 2022 10:04:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FAB46B0074; Mon, 3 Jan 2022 10:04:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id 016F46B0071 for ; Mon, 3 Jan 2022 10:04:41 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id AA7148249980 for ; Mon, 3 Jan 2022 15:04:41 +0000 (UTC) X-FDA: 78989297562.10.5926AAD Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf31.hostedemail.com (Postfix) with ESMTP id 6DE4620004 for ; Mon, 3 Jan 2022 15:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641222279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/azdTXQpdDt54c/qGW2Q0f96DDwXW7aJM/qGAElD6uU=; b=DBW2xbdlI851cMJop7n+2P1vej6vjBlm4he9NVcDyS2xLOaugjkr2F3LLL5ronizqm7VJq 4E1JlUQGpkybxupZQOxdmpKn2W390veOCx+BAi543KquDk42/VZXjsHrQlj4qS5AAmiAQW hYrFdKqsiQzV139sy1QV/b9aMst5Xa0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-577-TMjiKpjAPhGubCgj3Rz6nw-1; Mon, 03 Jan 2022 10:04:34 -0500 X-MC-Unique: TMjiKpjAPhGubCgj3Rz6nw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 032E91023F4D; Mon, 3 Jan 2022 15:04:32 +0000 (UTC) Received: from [10.22.9.34] (unknown [10.22.9.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A2862BCD9; Mon, 3 Jan 2022 15:04:30 +0000 (UTC) Message-ID: Date: Mon, 3 Jan 2022 10:04:29 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [RFC PATCH 3/3] mm/memcg: Allow the task_obj optimization only on non-PREEMPTIBLE kernels. Content-Language: en-US To: Sebastian Andrzej Siewior Cc: cgroups@vger.kernel.org, linux-mm@kvack.org, Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Thomas Gleixner , Peter Zijlstra References: <20211222114111.2206248-1-bigeasy@linutronix.de> <20211222114111.2206248-4-bigeasy@linutronix.de> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 6DE4620004 X-Stat-Signature: wn6zhmmxn5ohd3sr33zg69as4gbrwkmm Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DBW2xbdl; spf=none (imf31.hostedemail.com: domain of longman@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=longman@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1641222255-810195 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 1/3/22 09:44, Sebastian Andrzej Siewior wrote: > On 2021-12-23 16:48:41 [-0500], Waiman Long wrote: >> On 12/22/21 06:41, Sebastian Andrzej Siewior wrote: >>> Based on my understanding the optimisation with task_obj for in_task() >>> mask sense on non-PREEMPTIBLE kernels because preempt_disable()/enable() >>> is optimized away. This could be then restricted to !CONFIG_PREEMPTION kernel >>> instead to only PREEMPT_RT. >>> With CONFIG_PREEMPT_DYNAMIC a non-PREEMPTIBLE kernel can also be >>> configured but these kernels always have preempt_disable()/enable() >>> present so it probably makes no sense here for the optimisation. >>> >>> Restrict the optimisation to !CONFIG_PREEMPTION kernels. >>> >>> Signed-off-by: Sebastian Andrzej Siewior >> If PREEMPT_DYNAMIC is selected, PREEMPTION will also be set. My >> understanding is that some distros are going to use PREEMPT_DYNAMIC, but >> default to PREEMPT_VOLUNTARY. So I don't believe it is a good idea to >> disable the optimization based on PREEMPTION alone. > So there is a benefit to this even if preempt_disable() is not optimized > away? My understanding was that this depends on preempt_disable() being > optimized away. > Is there something you recommend as a benchmark where I could get some > numbers? In the case of PREEMPT_DYNAMIC, it depends on the default setting which is used by most users. I will support disabling the optimization if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_PREEMPT), just not by CONFIG_)PREEMPTION alone. As for microbenchmark, something that makes a lot of calls to malloc() or related allocations can be used. Cheers, Longman