Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp604380pxj; Thu, 17 Jun 2021 09:34:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyS9GEymDnOOz7tBjYtOUlHKHMRKZXQrZYsxNj9LYLDfPi0+Dc47EBqBQbuEM2x0xPZaiu7 X-Received: by 2002:a17:906:c247:: with SMTP id bl7mr6434974ejb.288.1623947685478; Thu, 17 Jun 2021 09:34:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623947685; cv=none; d=google.com; s=arc-20160816; b=YrfTH8NF3A40Ci6v0afgyTMKREwQ36DJfWROWzgfOp+BC9MblTNPZbcHwbFFVQN04s LXt+Vj9HsjNvkM5o5sXakPSkoTuUujvqwD7Fv6wbrbmcWlz0tPjs2cuNvpoxJLg7ILZn OmNDo3QwYJQtWy6UvSRKNId9WaGSuJgzaBo9tba0Mkp02+HgFD86Q/iO89NHoHAqSNv7 2atYpPoYZieNKCfiXvXEjUyTevCeRdu6rJhYetjIkmN1Y4KcaQFRkLG3cFjWhic0Kmm7 HTSiQBUWBsIPVtQtf8h5yRXlS8lS8I6Nl39XcIOPSivnooT9cblZzyrmfLLEPlxyMI65 6zVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=EAlFQCFoL81L/tLJBlboccsxVoDE0Z8vXNDI4pk2hvc=; b=Qy6iVyF2p4/m6UBNSfG504Qa3n5sHbrvnP3wfQTjRR4YxwB1aVPsvbxJvoX9UaPLrh OPt1SdOMFgUw8Dz1Dv9ZzYS70bcQc4DgdOGULdM6Jt5k3z4GY1os1I0lmAqQNnBjwWps Eg1VRUHEP1tcdrP3q5JH/gbZDa+jAZOjN8xoZf8emBe24COZGv1uGaC6876xPqWsIwr8 qRaH/wx8jiEstnkNy89w6tZH4l5X3b4/0sVaNpjAMp4hphXOARK8jPDEJntUPbt5vVMy DO32QHRMZXpEx2SjKScHc0tY3prZFnwXDyKT/hSdz0zco8z3v9vFwyYoT9u6+od8/GMG GkFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=HjXhwtnv; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=HjXhwtnv; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zo19si5873200ejb.452.2021.06.17.09.34.22; Thu, 17 Jun 2021 09:34:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=HjXhwtnv; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=HjXhwtnv; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232215AbhFQQUN (ORCPT + 99 others); Thu, 17 Jun 2021 12:20:13 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:35186 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233676AbhFQQTf (ORCPT ); Thu, 17 Jun 2021 12:19:35 -0400 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3E78E21B25; Thu, 17 Jun 2021 16:17:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623946646; h=from:from:reply-to: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=EAlFQCFoL81L/tLJBlboccsxVoDE0Z8vXNDI4pk2hvc=; b=HjXhwtnvK70Ue77X+pkfAYCkSnNc/Ck4f3yjsQ2QCQnCOoERnEZqvlHM0ScIuirw0MbqKf y6hGqJP9gMfED9vWn8JNbmnlJbHPOgVYuf/k+3QUO5YH94adMzUP8Y6jVRzUFN+OUVI86R 8BT/+dXF8ldEYSLPZO3TwEdhw+VjTo4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623946646; h=from:from:reply-to: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=EAlFQCFoL81L/tLJBlboccsxVoDE0Z8vXNDI4pk2hvc=; b=bq/+cNPYZLBWucoLuxSdpD0cHwkHLJNp/eLXulhJxyXFRKjR7BD7WGsiwwNbsE0CJBscro +/rhHGsMbhSWD3Dg== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id EF286118DD; Thu, 17 Jun 2021 16:17:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623946646; h=from:from:reply-to: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=EAlFQCFoL81L/tLJBlboccsxVoDE0Z8vXNDI4pk2hvc=; b=HjXhwtnvK70Ue77X+pkfAYCkSnNc/Ck4f3yjsQ2QCQnCOoERnEZqvlHM0ScIuirw0MbqKf y6hGqJP9gMfED9vWn8JNbmnlJbHPOgVYuf/k+3QUO5YH94adMzUP8Y6jVRzUFN+OUVI86R 8BT/+dXF8ldEYSLPZO3TwEdhw+VjTo4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623946646; h=from:from:reply-to: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=EAlFQCFoL81L/tLJBlboccsxVoDE0Z8vXNDI4pk2hvc=; b=bq/+cNPYZLBWucoLuxSdpD0cHwkHLJNp/eLXulhJxyXFRKjR7BD7WGsiwwNbsE0CJBscro +/rhHGsMbhSWD3Dg== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id BvI9OZV1y2B+IQAALh3uQQ (envelope-from ); Thu, 17 Jun 2021 16:17:25 +0000 Subject: Re: [PATCH v3 1/2] mm: compaction: support triggering of proactive compaction by user To: Charan Teja Kalla , akpm@linux-foundation.org, nigupta@nvidia.com, hannes@cmpxchg.org, corbet@lwn.net, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, aarcange@redhat.com, cl@linux.com, xi.fengfei@h3c.com, mchehab+huawei@kernel.org, andrew.a.klychkov@gmail.com, dave.hansen@linux.intel.com, bhe@redhat.com, iamjoonsoo.kim@lge.com, mateusznosek0@gmail.com, sh_def@163.com, vinmenon@codeaurora.org Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org References: <7db6a29a64b29d56cde46c713204428a4b95f0ab.1622454385.git.charante@codeaurora.org> <88abfdb6-2c13-b5a6-5b46-742d12d1c910@suse.cz> <0ca491e8-6d3a-6537-dfa0-ece5f3bb6a1e@codeaurora.org> <0d516cfa-f41c-5ccc-26aa-67871f23dcd3@suse.cz> <8d91a81b-09f3-e814-c9ce-16ff246ed359@codeaurora.org> From: Vlastimil Babka Message-ID: <546f7169-5a9e-fe16-bd83-b0f7a338c3cf@suse.cz> Date: Thu, 17 Jun 2021 18:17:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <8d91a81b-09f3-e814-c9ce-16ff246ed359@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/17/21 6:05 PM, Charan Teja Kalla wrote: > The wait_event/freezable_timeout() documentation says that: > * Returns: > * 0 if the @condition evaluated to %false after the @timeout elapsed, > or > * 1 if the @condition evaluated to %true after the @timeout elapsed, > * or the remaining jiffies (at least 1) if the @condition evaluated > * to %true before the @timeout elapsed. > > which means the condition must be evaluated to true or timeout should be > elapsed for the function wait_event_freezable_timeout() to return. > > Please check the macro implementation of __wait_event, where it will be > in for(;;) till the condition is evaluated to true or timeout happens. > #define __wait_event_freezable_timeout(wq_head, condition, timeout) > > ___wait_event(wq_head, ___wait_cond_timeout(condition), > > TASK_INTERRUPTIBLE, 0, timeout, > > __ret = freezable_schedule_timeout(__ret)) > > Thus the plain wakeup of kcompactd don't do the proactive compact work. > And so we should identify its wakeup for proactive work with a separate > flag. OK, you're right, I forgot that the macro has the for loop to guard against spurious wakeups.