Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4944462imu; Tue, 29 Jan 2019 10:05:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN7kHJP53FKpSNwRjGo/m2lT/bU8R5zAFCL/K8LB0ucJBhZ2sh9dQ/iZLgzQ/bdAoAKhJcQa X-Received: by 2002:a62:9fd9:: with SMTP id v86mr26991486pfk.191.1548785159436; Tue, 29 Jan 2019 10:05:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548785159; cv=none; d=google.com; s=arc-20160816; b=KS+k0vhruv2XZsGwdfFHwUjGmqbuB2hVLnDelI4vnHXNgSrp0lp/4lafJZKG2a8nLm BfqEJJDUD41pQQQyssW3lSYSeNNO8HrT08gBAix1Lksj0DYe/WmKwRkUcS/fpp+nHN+k ku/hBhLfXuc6aICPvAipaYgfVyjqVtLl2u5OJheTUndWNthdL1naGga1up6X3gglx7mJ S473/S9ahn16QZGyoHuk4r6suzFmVt1OUdKCB+sIqWYdo1bijrSZk9/SMlzMAgHySxdd YCC06WrMAfjXI2+R5CVM57VDpAe5ouYoCcGNd+qeRUK1oeL3wRGsNkrbD0bygI0zpcIS ymFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Y+ap6Bq9i9Bosxjv/aC11VsPIK0N0Zh2bt/qMaK7RFo=; b=x4dCdVmgvMUHe3tiRXlSgLinLd72vnPvJ4V6/BXXT3MGcT5nvUg7qPyy9VF33uSjIl 96uNEMy+mO33ucCiGkv5+DSMVSiECoJbqYOO/20a/Qd1ktGj3zr2auVlmhXkHywCfy6J xB8DX82zBotvs5zhu/Hmpy0VOsLOCi8kbnXwvi/5GvVM8Ibk+9eeQEV8nO8SrFzSyreB bu992UrrVTUcyga6iYSQN243f6cQjhlBGu/9H6zKzDPsEyV4EQglYLbgG9qtOQpNnS5N cNpiH9NLx7VjVDquLxiAzcvySmKqnqdN6PCHtBqOB3gCdYIRIvulby6Z5QKtVOaLl7Ok oOdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=pTMYdsjV; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12si35974635pls.32.2019.01.29.10.05.42; Tue, 29 Jan 2019 10:05:59 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=pTMYdsjV; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728818AbfA2SFU (ORCPT + 99 others); Tue, 29 Jan 2019 13:05:20 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:40112 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727100AbfA2SFU (ORCPT ); Tue, 29 Jan 2019 13:05:20 -0500 Received: by mail-wm1-f67.google.com with SMTP id f188so18752289wmf.5 for ; Tue, 29 Jan 2019 10:05:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Y+ap6Bq9i9Bosxjv/aC11VsPIK0N0Zh2bt/qMaK7RFo=; b=pTMYdsjVGlPjGB46EzZOJP2ZzDqCQrAqtMKteb4meGoxCxhdPbKwQR1sea+cC+6KTW G+seq4FJVEvK5CRhVUtH84btkAFM7Xc4jxG+SDLF8sUlDknTuC2WFvELFSNqQRh3hYCG CvcEgmI2ubiEKT3037EZFz8oCFJ9h2vrXZeY/DN5KatkMVTeIUt85CojWalyztZWPCu9 5UNFCramOZsutLuabzLGoYyV22vjYFlPJrv+sIbEz+foWtJ/T43QYM6ELa5elREGVVhI DNszJWv4OwXbAtfHWrgmqegPvT7xs193W6REmvUd1rwEKb5NxMrkXxmOSbFn7DV+Sf2Z wrqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Y+ap6Bq9i9Bosxjv/aC11VsPIK0N0Zh2bt/qMaK7RFo=; b=BWgnLCMy94qb5DcZVM1kqxjZqTNk1kxCb7f7OaqIwanXRuWmni9BviP5PNs8662dpV u58oLNW6CsHe0FOY4zNTI5CPQItfNu5tu5in9zNSdsqs+aoYSwEbBtRhq9+dnCESHvcl Umzxkz/Ke+owuoK1BT/HnIDiyopnS5lV7S1MS9VwF2b9TOQZxaf4injG2ZloPaVkxui9 PPwH3GPafQCsLiaBKuUqmbAUmV4gP2PnpB+h3f7UTbtW0bBWDDUh601PA3QcZFD+YRfa ZWiLq6I1qZONmC7V6OvNOVobtXB7n+abHo7kRiutCiwtbLM++8i2AxbXKJ+pVgymVVr4 CbrA== X-Gm-Message-State: AJcUukf5KKybc6Mh8UHf8uSdqa5wxWLnpHYMNXbHxRNRbDlZwmXVxd1y z6MtD9GQEqoOGGKBCNIE5rVJGIJHMkvJK6bT8C4ynQ== X-Received: by 2002:a7b:c04e:: with SMTP id u14mr20579255wmc.133.1548785118461; Tue, 29 Jan 2019 10:05:18 -0800 (PST) MIME-Version: 1.0 References: <20190124211518.244221-1-surenb@google.com> <20190124211518.244221-6-surenb@google.com> <20190129104431.GJ28467@hirez.programming.kicks-ass.net> In-Reply-To: <20190129104431.GJ28467@hirez.programming.kicks-ass.net> From: Suren Baghdasaryan Date: Tue, 29 Jan 2019 10:05:07 -0800 Message-ID: Subject: Re: [PATCH v3 5/5] psi: introduce psi monitor To: Peter Zijlstra Cc: Greg Kroah-Hartman , Tejun Heo , lizefan@huawei.com, Johannes Weiner , axboe@kernel.dk, dennis@kernel.org, Dennis Zhou , Ingo Molnar , Andrew Morton , Jonathan Corbet , cgroups@vger.kernel.org, linux-mm , linux-doc@vger.kernel.org, LKML , kernel-team@android.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for review Peter! On Tue, Jan 29, 2019 at 2:44 AM Peter Zijlstra wrote: > > On Thu, Jan 24, 2019 at 01:15:18PM -0800, Suren Baghdasaryan wrote: > > static void psi_update_work(struct work_struct *work) > > { > > struct delayed_work *dwork; > > struct psi_group *group; > > + bool first_pass = true; > > + u64 next_update; > > + u32 change_mask; > > + int polling; > > bool nonidle; > > + u64 now; > > > > dwork = to_delayed_work(work); > > group = container_of(dwork, struct psi_group, clock_work); > > > > + now = sched_clock(); > > + > > + mutex_lock(&group->update_lock); > > actually acquiring a mutex can take a fairly long while; would it not > make more sense to take the @now timestanp _after_ it, instead of > before? Yes, that makes sense. As long as *now* is set before the *retry* label, otherwise the retry mechanism would get even more complicated to understand with floating *now* timestamp. Will move the assignment right after the mutex_lock() > -- > You received this message because you are subscribed to the Google Groups "kernel-team" group. > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com. >