From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 9 13:31:35 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41D8F1065674; Wed, 9 Nov 2011 13:31:35 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id A12898FC13; Wed, 9 Nov 2011 13:31:34 +0000 (UTC) Received: by eyd10 with SMTP id 10so1837781eyd.13 for ; Wed, 09 Nov 2011 05:31:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=hgCfT0Iy4+gRGqeGDsVM/rXVzVWStuXHX0KCnbTDog0=; b=Gfg+8o1QLh1OHvL3rReusd4527GOsMUXvOYGvwKVspUYYaeIHvH6DnOgbUmj74Uo8s Q4MzmYE6IjPEcn4lwEisuwnu35XSjv2PS2lCM8Y1LzR0br04aP7pW8R4luv49pR7zY3o QKqDBOHPiOFSiBtURMc1ha9CT80adQqK3WOyU= Received: by 10.213.14.12 with SMTP id e12mr15808eba.113.1320845493652; Wed, 09 Nov 2011 05:31:33 -0800 (PST) Received: from localhost ([94.27.39.186]) by mx.google.com with ESMTPS id 54sm13508546eex.8.2011.11.09.05.31.28 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Nov 2011 05:31:32 -0800 (PST) From: Mikolaj Golub To: Kostik Belousov Organization: TOA Ukraine References: <86vcr21agm.fsf@kopusha.home.net> <20111105135801.GT50300@deviant.kiev.zoral.com.ua> <86ehxmpogp.fsf@kopusha.home.net> <20111105154443.GB50300@deviant.kiev.zoral.com.ua> <86ehxmjsza.fsf@kopusha.home.net> <20111105194553.GK50300@deviant.kiev.zoral.com.ua> <8662iyjof9.fsf@kopusha.home.net> <20111106181041.GH50300@deviant.kiev.zoral.com.ua> <86r51iqoad.fsf@kopusha.home.net> <20111109124455.GW50300@deviant.kiev.zoral.com.ua> <20111109125329.GX50300@deviant.kiev.zoral.com.ua> Sender: Mikolaj Golub Date: Wed, 09 Nov 2011 15:31:26 +0200 In-Reply-To: <20111109125329.GX50300@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Wed, 9 Nov 2011 14:53:29 +0200") Message-ID: <86zkg5h175.fsf@in138.ua3> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-hackers@freebsd.org, Robert Watson Subject: Re: "ps -e" without procfs(5) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 13:31:35 -0000 On Wed, 9 Nov 2011 14:53:29 +0200 Kostik Belousov wrote: >> And now you return success and nothing gets copied out for the process >> in P_INEXEC state. Either you should return an error like EAGAIN, or >> consider the P_INEXEC state as transitional and wait till process >> leaves it. Or, ignore the state as it was before, and return whatever >> error proc_rwmem generated (my preference). KB> Forgot to say that the check does not change much because you drop KB> process lock immediately after the check, so the process may enter KB> the INEXEC state right after the check. I believe you already tried KB> to do this with P_WEXIT. Good point :-). Although after adding the P_INEXEC I have not seen errors any more, while before they were often (when running 'procstat -ca' in loop and building world simultaneously). Thus it looks like the probability is much smaller. So, it still looks good for me to check for P_INEXEC and return EAGAIN, and add the comment why we do this and that it still racy. But if you still think that ignoring the state is the best option no problems for me to return it back. -- Mikolaj Golub