Received: by 10.223.176.46 with SMTP id f43csp357077wra; Thu, 18 Jan 2018 18:39:32 -0800 (PST) X-Google-Smtp-Source: ACJfBovdaThK68BIczHhqF9uWwJ6G3BVTQeuPNOAsaUFnk/hLr3HwnWDcVmIJf//+tpS+kWOjmZt X-Received: by 10.99.126.26 with SMTP id z26mr34233574pgc.151.1516329572821; Thu, 18 Jan 2018 18:39:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516329572; cv=none; d=google.com; s=arc-20160816; b=a5WebJG1kD4mr9PP6SiDhAUWlG40xEKwrU4dKD0t5dastPV2OuoRnhb9ttYxBdC1aQ q9kn09ow8JEJkHOskxIJ0eth9JbTQU4cLtSaTks3lGILcZqm2z0XM8naAFSrbdZLpJwB r3YeDr38qYmDjkQkA4LwcF52ZlyZcAmrud4Tov4QiGU90NgWaR9t1Z1rysirHRjGiCgd kv1M5c1ionVNdAMTePw7w6Dyg/Ct3nbY4ls9b1awOpnPNpdL09yYc6E+osjD3S2LHwli UkTQYE1yNeTJ/VItVnt8IPW/Gx6Uq8Iw00R4gd9Pq+t0pwlZhAs1p7SeRNVTtkVFbFNI l4Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=q3bGI8Epzh4jpx4f+hwUb/YzR9Ujgvoi2idSIuwGCxI=; b=V4KBeZvEQkMZhahRtuYs5SpWe/q0T//84ObTSK++ldisdoCxeyUtMVLUYx8DuxRKEL PmGVulDjw1mSixszTHgAGmpQ4DS7SRNJ66J5lwwmm4crHzh/32PDeaYXZv34k/Hbi18B fsBDravi9yvo/dOuIDoxLZLOSqPcsyJgqpDlyLydYpW+seArPbRMKwsebhGj1YfZD0Rz Dh+oC7yI1keQNFa5VMErB3y6uV3xzgAH9nUF1UOVbLyE3Jm0IayBplOMvL8JSzqa/4XK 8aLypcs66TzNNF7o4rIGdFCfidmWlxXZh1BWA9VC+LtVZfMviHqOZXKd2L3Js4By4i+g fOKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11si7316354pgp.751.2018.01.18.18.39.18; Thu, 18 Jan 2018 18:39:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755397AbeASCh0 (ORCPT + 99 others); Thu, 18 Jan 2018 21:37:26 -0500 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:36074 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752855AbeASChT (ORCPT ); Thu, 18 Jan 2018 21:37:19 -0500 Received: from unknown (HELO lgemrelse6q.lge.com) (156.147.1.121) by 156.147.23.51 with ESMTP; 19 Jan 2018 11:37:17 +0900 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: byungchul.park@lge.com Received: from unknown (HELO ?10.177.222.184?) (10.177.222.184) by 156.147.1.121 with ESMTP; 19 Jan 2018 11:37:16 +0900 X-Original-SENDERIP: 10.177.222.184 X-Original-MAILFROM: byungchul.park@lge.com Subject: Re: [PATCH v5 1/2] printk: Add console owner and waiter logic to load balance console writes To: Steven Rostedt Cc: Petr Mladek , Sergey Senozhatsky , akpm@linux-foundation.org, linux-mm@kvack.org, Cong Wang , Dave Hansen , Johannes Weiner , Mel Gorman , Michal Hocko , Vlastimil Babka , Peter Zijlstra , Linus Torvalds , Jan Kara , Mathieu Desnoyers , Tetsuo Handa , rostedt@home.goodmis.org, Sergey Senozhatsky , Tejun Heo , Pavel Machek , linux-kernel@vger.kernel.org, kernel-team@lge.com References: <20180110132418.7080-1-pmladek@suse.com> <20180110132418.7080-2-pmladek@suse.com> <20180117120446.44ewafav7epaibde@pathway.suse.cz> <4a24ce1d-a606-3add-ec30-91ce9a1a1281@lge.com> <20180117211953.2403d189@vmware.local.home> <171cf5b9-2cb6-8e70-87f5-44ace35c2ce4@lge.com> <20180118102139.43c04de5@gandalf.local.home> From: Byungchul Park Message-ID: <45bc7a00-2f7f-3319-bfed-e7b9cd7a8571@lge.com> Date: Fri, 19 Jan 2018 11:37:13 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180118102139.43c04de5@gandalf.local.home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/19/2018 12:21 AM, Steven Rostedt wrote: > On Thu, 18 Jan 2018 13:01:46 +0900 > Byungchul Park wrote: > >>> I disagree. It is like a spinlock. You can say a spinlock() that is >>> blocked is also waiting for an event. That event being the owner does a >>> spin_unlock(). >> >> That's exactly what I was saying. Excuse me but, I don't understand >> what you want to say. Could you explain more? What do you disagree? > > I guess I'm confused at what you are asking for then. Sorry for not enough explanation. What I asked you for is: 1. Relocate acquire()s/release()s. 2. So make it simpler and remove unnecessary one. 3. So make it look like the following form, because it's a thing simulating "wait and event". A context --------- lock_map_acquire(wait); /* Or lock_map_acquire_read(wait) */ /* "Read" one is better though.. */ /* A section, we suspect a wait for an event might happen. */ ... lock_map_release(wait); The place actually doing the wait --------------------------------- lock_map_acquire(wait); lock_map_release(wait); wait_for_event(wait); /* Actually do the wait */ Honestly, you used acquire()s/release()s as if they are cross- release stuff which mainly handles general waits and events, not only things doing "acquire -> critical area -> release". But that's not in the mainline at the moment. >>> I find your way confusing. I'm simulating a spinlock not a wait for >>> completion. A wait for completion usually initiates something then >> >> I used the word, *event* instead of *completion*. wait_for_completion() >> and complete() are just an example of a pair of waiter and event. >> Lock and unlock can also be another example, too. >> >> Important thing is that who waits and who triggers the event. Using the >> pair, we can achieve various things, for examples: >> >> 1. Synchronization like wait_for_completion() does. >> 2. Control exclusively entering into a critical area. >> 3. Whatever. >> >>> waits for it to complete. This is trying to get into a critical area >>> but another task is currently in it. It's simulating a spinlock as far >>> as I can see. >> >> Anyway it's an example of "waiter for an event, and the event". >> >> JFYI, spinning or sleeping does not matter. Those are just methods to ^ whether spining or sleeping doesn't matter. >> achieve a wait. I know you're not talking about this though. It's JFYI. > > OK, if it is just FYI. Actually, the last paragraph is JFYI tho. > -- Steve > > > -- Thanks, Byungchul