Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp993174imu; Tue, 20 Nov 2018 09:55:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/XnoYk+TUn6jqZsZqjCzUhKsq8RxHFk5h1G12QYNCs5pyF/mHGEUthHQsI6qWeEoX8sP/Aa X-Received: by 2002:a63:24c2:: with SMTP id k185mr2716028pgk.406.1542736558118; Tue, 20 Nov 2018 09:55:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542736558; cv=none; d=google.com; s=arc-20160816; b=P9TD3Wq4wyWwWzsQc/dQcU+nEJMb4gUPUc+iV8HVn+j4WZ3gdrv+s610iWp6T8mdHe 9U0szQPHIAxuLbEgBn2X/7dD/M/Bz/7os73gu1NLeJkCDu6gY4WQaLWRqBtLKzJxRh+D h6odT4atNGZ/Ml1hxTkSDL2lzQBv/2twi5yUjBpMFCtPUpeW9SUmoAzlV+fVW1NmztOg Kkhrilfl9y92qqZtJUNN11eAPFwUJWITWT7vf7tkajFA4eD/b6R3HKTlqeimTfNOATjz jTswWoOLKx1+ZCC69Z1oIk7JHD+mSQMabXZn1FthIhdNICfBRR1C9UX+ucP4zzs5tbii 6X8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GFkje0LByaHXSh5jvs9SoRz0ZbkPFdiSkn9hiMbBcVg=; b=nq/rKG0uD1ck+JVPbhpzgIXz73BDzlyVvuqH8bIw3OJm9zctQCuNtBuZr3ihC3U2tC AJ3DRI361Cg3gtDJM2uOiGzDTkrx9M/ushGfMAuKdozMGaOfKDE1i0AFc+cw907Qpqrm zBPDm+w1e+xJz+/X4W90VyJyrgwS6yezTJr1EgsO3OIWlJmf5TjJLaAx1sWul9Cc+/34 dy6MOoR2xqamQ78N773vrqXg989gb+HgXyREakYHfG0uvy35snnXOzGirofsFOgS5rrR KOTGT7/r7n8Ikx8rmZUcphbJrzSrqMKAzy5yM+Z6Oc1Esirb9sINiLbosPIjH2CXybMp Q2aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="NfoQ/pVk"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7si17590100pfb.237.2018.11.20.09.55.43; Tue, 20 Nov 2018 09:55:58 -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=fail header.i=@gmail.com header.s=20161025 header.b="NfoQ/pVk"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728085AbeKUCoR (ORCPT + 99 others); Tue, 20 Nov 2018 21:44:17 -0500 Received: from mail-qk1-f195.google.com ([209.85.222.195]:44598 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728004AbeKUCoQ (ORCPT ); Tue, 20 Nov 2018 21:44:16 -0500 Received: by mail-qk1-f195.google.com with SMTP id n12so3119031qkh.11 for ; Tue, 20 Nov 2018 08:14:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GFkje0LByaHXSh5jvs9SoRz0ZbkPFdiSkn9hiMbBcVg=; b=NfoQ/pVkyOfcy23Lw52m1s3ErqGUYCRcDn34Q8p5/ovvhPs8o+lhTsuMmFwFZ/NIfN NtvyC6z/zAbhIwh+E3R/DlPYtTznBTsF9+ZbuLje53KPeQ337qtv3WyZELN5Anq82xbL U7j0m1o65w9ozD3mMkuxG/zpRUz5FFQTJTVZCGsqeq2deK2C4YOuUXZ/hzglNa+9m4io ioYg1NdY5SC+E6QrBiupaURwv1p8yqo1C3qA9OEX9xqApSnGECOBhnSoCiNpic/HLx55 X9mq6pD+NZ1zEa4B+UJFZdtslJPcWHHdvGUq/54+aJuVA4NbBgcuvYgc0qVYJ285KgkH /4Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=GFkje0LByaHXSh5jvs9SoRz0ZbkPFdiSkn9hiMbBcVg=; b=eQp59RSstup+0hYLLVGvwfsNqCz8QUvDXFEFXIi+e3bRWFiC2Qu0ahmNMm6H46+Y4c PyfdPT32GpMQkz9pq9XTn0GHNA9W0N4dgd00H+MgNBZ59U/+KyZBn6l303dyg1DYNZqs LPoOP7FQLeRW8bGe5Yj9N87iaVaqtsAYxgHMwwRwBhFMyWRc9qjdnLr1VR5Rn4kfDMYu nClSKcmGYtMVlN+zWrJAspBKmQipfHku1E5ZrJ5FL+KDZE3oo17hkWHh4OmCTQIzP85h NuZL9lo+IBv+LnpmJsOE+5qdAmpQM6RQqrgNAzWr1+urorZ9Gl7qGYZIxD7A3IpQnmNy kZGw== X-Gm-Message-State: AA+aEWb5ghclQtaMH2LCxeYkjUq8POZrBmy9wHAsKnco93MHUvR6Aaps c55NlOU3JFPOxZYAig9Rqmk= X-Received: by 2002:a37:358d:: with SMTP id c135mr2224078qka.232.1542730462667; Tue, 20 Nov 2018 08:14:22 -0800 (PST) Received: from localhost ([2620:10d:c091:200::7:4b6a]) by smtp.gmail.com with ESMTPSA id n3sm25005699qtc.81.2018.11.20.08.14.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 08:14:21 -0800 (PST) Date: Tue, 20 Nov 2018 08:14:19 -0800 From: Tejun Heo To: Radu Rendec Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH 1/1] Improve kernfs_notify() poll notification latency Message-ID: <20181120161419.GS2509588@devbig004.ftw2.facebook.com> References: <20181116020954.24924-1-radu.rendec@gmail.com> <20181116020954.24924-2-radu.rendec@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181116020954.24924-2-radu.rendec@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 15, 2018 at 09:09:54PM -0500, Radu Rendec wrote: > kernfs_notify() does two notifications: poll and fsnotify. Originally, > both notifications were done from scheduled work context and all that > kernfs_notify() did was schedule the work. > > This patch simply moves the poll notification from the scheduled work > handler to kernfs_notify(). The fsnotify notification still needs to be > done from scheduled work context because it can sleep (it needs to lock > a mutex). > > If the poll notification is time critical (the notified thread needs to > wake as quickly as possible), it's better to do it from kernfs_notify() > directly. One example is calling sysfs_notify_dirent() from a hardware > interrupt handler to wake up a thread and handle the interrupt in user > space. > > Signed-off-by: Radu Rendec Acked-by: Tejun Heo Greg, can you please route this one? Thanks. -- tejun