From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B794D39657E for ; Tue, 31 Mar 2026 07:19:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774941554; cv=none; b=ccXRBBb4K724IBL3AQUlz/c23DEgFW61SVwhung/RmcwkMdB+RApAaPOJZbkmnKp2e4bRBiQOhvmI2CQxAD9xH60eC0MaNc11SwzNZut3SFDheBXC8RzR/lS6PHHyzAiqFy7ahcAZL5OmsoXp59gSkDO9rumDPQjCFnWjaA67SY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774941554; c=relaxed/simple; bh=jT4qFRXDMssN5Ffbg/Yb3DOawxErxMSqyE5BmmWF2cw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZTSLuDZCvnsnabzQmVj6F6nI/oPI6W1ZX7IL4u6LUecYQUOI2mYJ4qXkWZcQ89S3lkTIl4e6WbNH1Xzn/HCkbk/yxp8vxTduwOR+4wbBRMaPJ3zvjTlOadzu3IP8M9ZUCKtj2XQW+9WzDyHikJ9yoCnL1K10d93VvVhYVIOf2zA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=QVztDZB1; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=F6D7TPbN; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QVztDZB1"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="F6D7TPbN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774941551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=N67mJoT6zBu5iQWKt0B0XRjd20kwe4lBGYJ6EUJjjbw=; b=QVztDZB17/8R6kNWeTe7poUlxbNp4Yf7B8acbMwL3sRH35i3s63NuzsnJMU0vi30wZqGIx jWItw6uIKLZyFzy0tWT8CXygQMW1s2RWn3mggcDLeIg4Pnq/atSX25USdx8cz1UOgRPUBQ WvX3/gcr2wFYvuHQRI76Gq0ECPYXabY= Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-167-n_mWtUfEP9uDk4hITwXisA-1; Tue, 31 Mar 2026 03:19:10 -0400 X-MC-Unique: n_mWtUfEP9uDk4hITwXisA-1 X-Mimecast-MFC-AGG-ID: n_mWtUfEP9uDk4hITwXisA_1774941549 Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-c7424d91b2dso3394614a12.1 for ; Tue, 31 Mar 2026 00:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1774941549; x=1775546349; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=N67mJoT6zBu5iQWKt0B0XRjd20kwe4lBGYJ6EUJjjbw=; b=F6D7TPbNmuEwpETgOePe+GoLv7LYQdKHo00+NxkuZKVM9N+1gJh2yY3jfoI7YcEKyu 27CAL9kLoBLMMscN5dq7Jw0Q1UMZBURPDp+JskzRLl3u6el+KHDkw9TfpV6cDJ97MQnW DwbobbVdHSB0e/nRHlj//B3AvH22RWy9hR1Yf3PVuOujZMByCyrc1Mvj2E9Hrtwgc/Ro oXirAsqflJwNBturQWTdDjx9PTFfOalCHlinDNxS7mzT2faHfV+ZKzOCEiPDYOD0/PSh 2u4NA2IMDJXzE0iZd+vkbbPoeGh5arzsK8d/IEq4vCOWNymOX7JnBGUMYqFtc8pkSIdI Mrug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774941549; x=1775546349; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N67mJoT6zBu5iQWKt0B0XRjd20kwe4lBGYJ6EUJjjbw=; b=i8Ti6QICUBtr/OexNbsee100s2MCGRQb1ubnKemoQXpI6iladWROu3XEqE/0SPFpsX HsUcdyaFaqwUtJf0fLQ45exuKiO3FIZtkj/zqrpEbxFigKiOJLnoQjlRE3h5OrOBxCZu DQxQ0DReq9yOAyCO0RbCqFQMp7ancr3NVcc0og7KhQ8CI+5M4PGpXcmkZjKOMEz9b00G WWuZqFKqtdC7eK/RVJ+ReaFKtOx7OkeHKb+czIFp7yhgPvZfO6d56vGA/z711DMQiy8e fDmI3aKRjHONhBgyweeyszm1lKVEnt357AtJO4M2Jxz44CTwCbbs0I0qwUUMeTjD4uW8 yMkQ== X-Forwarded-Encrypted: i=1; AJvYcCXfxVFiKopqGHitsZabOTwFTrPh51iVHRcVuJQLLYZ/s7pkpwAS5XWfPZw7Vz3t93br/PSPc41uJBjWcYs=@vger.kernel.org X-Gm-Message-State: AOJu0YyRUyIU7ktanKP9o+k571VbA0sC6KZXCL1Mp6nXmbQ0/o00pJgZ ChN5yt3ZakbVD8PM1qWZp3B8tCULUlBFolkQBWMHdDTGE1rGl8isn/sh62atyJA8XQ1Z+xAv01Z h+qaq7vY2hxa7MA+JRX8Sj+sM1dLKm9r9jEDKhAM5iuVp8hsvOuyj51DTkYkgNh0YIA== X-Gm-Gg: ATEYQzw3XV89jD0gJ/qHidaFBoAkqLGPy/onrOXpAjq2Fd5jcoIZhAuRN6E/D6VBU/w jfnhsiQKfkzRQ4TAep7MF5vmo05LyMm2CuoB76UMorJcVBFeYOAGZ0ebYb/7OsB78T5ZmSCN32h fM0xj8+4qTEnBps74NB2UiJu6Rw5Qn9q2cTEEhEZpnnKDWxVIGkVxr7mpi2VkwkNUCXCBPdSQrr oHOHvjaD7Y9OqY2ou0MTM0UEvKWI2of7zQalO/onn3OlXIindBeuvO+gBxSfsZJfRvYrGooDFrt WZze6XsV/R6N+RdFgT8al7rzRxLo8+YdnhN0x6BCz1f3jokIjRjRSO6w9iwMsSSz4mnIQIvyzTN Awm/VcPLdsE20Hz1hhg== X-Received: by 2002:a05:6a00:438a:b0:82c:7f08:8826 with SMTP id d2e1a72fcca58-82c95e915fdmr13708631b3a.17.1774941549237; Tue, 31 Mar 2026 00:19:09 -0700 (PDT) X-Received: by 2002:a05:6a00:438a:b0:82c:7f08:8826 with SMTP id d2e1a72fcca58-82c95e915fdmr13708602b3a.17.1774941548801; Tue, 31 Mar 2026 00:19:08 -0700 (PDT) Received: from redhat.com ([209.132.188.88]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82ca849849fsm11095413b3a.26.2026.03.31.00.19.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2026 00:19:08 -0700 (PDT) Date: Tue, 31 Mar 2026 15:19:05 +0800 From: Li Wang To: Andrew Morton Cc: david@kernel.org, ljs@kernel.org, Liam.Howlett@oracle.com, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, shuah@kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/4] selftests/lib.mk: set PWD from CURDIR to avoid wrong extmod path Message-ID: References: <20260331040156.119158-1-liwang@redhat.com> <20260331040156.119158-3-liwang@redhat.com> <20260330223025.4ad1cdb9b79e242f01d8b83d@linux-foundation.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260330223025.4ad1cdb9b79e242f01d8b83d@linux-foundation.org> On Mon, Mar 30, 2026 at 10:30:25PM -0700, Andrew Morton wrote: > On Tue, 31 Mar 2026 12:01:55 +0800 Li Wang wrote: > > > When running selftests from the kernel top-level (e.g. make kselftest-all), > > sub-makes might still inherit the caller's PWD from the environment. > > > > Some selftests use $(PWD) in recursive kbuild invocations, which can > > then incorrectly resolve to the kernel top directory instead of the > > current test directory. > > > > In that case, kbuild may generate an external-module wrapper Makefile in > > the wrong location, potentially clobbering the top-level Makefile and > > causing recursive include failures ("Too many open files"). > > > > Export PWD := $(CURDIR) in selftests/lib.mk so $(PWD) always matches the > > actual current selftest directory. > > > > Reported-by: Andrew Morton > > Signed-off-by: Li Wang > > I couldn't clearly figure out what I was doing to cause kbuild to > destroy my top-level Makefile. It happened three times and it wasn't > fun so I Stopped Doing That. > > I tried a bunch of things *without* this patch and of course, Makefile > is still intact. So I cannot confirm or deny, sorry. > > I've switched my script so I'll henceforth be running -j100, shall keep > an eye on things. No problem, actually I wasn't able to reproduce it, the patch just worked out based on your description. We can kick out it from patchset unless someone confirm it is needed. -- Regards, Li Wang