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 C77CCC433F5 for ; Thu, 23 Dec 2021 21:48:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 000ED6B0072; Thu, 23 Dec 2021 16:48:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EF1F26B0073; Thu, 23 Dec 2021 16:48:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB9BB6B0074; Thu, 23 Dec 2021 16:48:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0212.hostedemail.com [216.40.44.212]) by kanga.kvack.org (Postfix) with ESMTP id CBBED6B0072 for ; Thu, 23 Dec 2021 16:48:49 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7E1E01802BC96 for ; Thu, 23 Dec 2021 21:48:49 +0000 (UTC) X-FDA: 78950399178.03.ABB9CB8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf24.hostedemail.com (Postfix) with ESMTP id 5B2A618002F for ; Thu, 23 Dec 2021 21:48:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640296128; 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=8aOo+PkY5S4h+Nfs7B8aAFLKqPmDvtOJfX8JOA95JqA=; b=akts5PteprvzWP94+7E74i064L1/+3QZ60fdR3Hvuvos5K6aYwZNw1buhQdj9GgHGqA77x ZylWQUZEAg4SmboVMHFaCpZlrK5e5QL+QoSjcIwPmik2Ofj5/93A+1WJuOycNR0bvjvozG 7DkOskEPn2n99YWp4oUiO5T5rzKzOXQ= 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-614-7l4heniYOzabyI4fv3Kasw-1; Thu, 23 Dec 2021 16:48:45 -0500 X-MC-Unique: 7l4heniYOzabyI4fv3Kasw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 64AA31006AA0; Thu, 23 Dec 2021 21:48:43 +0000 (UTC) Received: from [10.22.16.147] (unknown [10.22.16.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 474B36E1EE; Thu, 23 Dec 2021 21:48:42 +0000 (UTC) Message-ID: Date: Thu, 23 Dec 2021 16:48:41 -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 , cgroups@vger.kernel.org, linux-mm@kvack.org Cc: 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: <20211222114111.2206248-4-bigeasy@linutronix.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 5B2A618002F X-Stat-Signature: t4pri5tj3cqspsgu3gjtoz5a1nu1h1h8 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=akts5Pte; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf24.hostedemail.com: domain of longman@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=longman@redhat.com X-HE-Tag: 1640296124-111263 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 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. Regards, Longman From mboxrd@z Thu Jan 1 00:00:00 1970 From: Waiman Long Subject: Re: [RFC PATCH 3/3] mm/memcg: Allow the task_obj optimization only on non-PREEMPTIBLE kernels. Date: Thu, 23 Dec 2021 16:48:41 -0500 Message-ID: References: <20211222114111.2206248-1-bigeasy@linutronix.de> <20211222114111.2206248-4-bigeasy@linutronix.de> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640296130; 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=8aOo+PkY5S4h+Nfs7B8aAFLKqPmDvtOJfX8JOA95JqA=; b=WzHw8uXVCFI0EEXgSUYeXPoomqlPWLFfFpZi8Ez4aX1a39pGpg4TNhTcv/JudN/CMlEkg9 a28WyYraaZd2PfwhoXqGTWSpS/Q1pm5oBIxWB5WYJ+lJQ5iE5m0B7cA5anf8uINTgiVWEB xgHZyjDKEKpREhc3QYR8U5HYhHUKdlE= Content-Language: en-US In-Reply-To: <20211222114111.2206248-4-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Sebastian Andrzej Siewior , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Thomas Gleixner , Peter Zijlstra 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. Regards, Longman