From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C891225D9 for ; Mon, 24 Jun 2024 18:54:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719255276; cv=none; b=F8cd0esJ4zwo7DwRdtAhs6l/WZWdiY6vlsuBNRnWO4QR5eF41M/InCgabIFT0Rb/IrvanNIDPqGLNlFe/AGvhpJ1JVMPCo+QleD5TkeYUjztNT99/Yp3JedY1hagDgkc8pzjUBkh8v/xUdxmv4Xh1OgU1WwL21CFlGwEY4SNoMM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719255276; c=relaxed/simple; bh=+aHo+RDnT/WvmjPAgH8TsZySNNBozthwDDf/TaQIdEc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=rtYCGWfXi5/55XPkqQZi/rN1UlIpSZw6n0Qv/fICbKvXwIty+yQR5ZDU0vcWHqr7djncrfxc+QhebjJBXR7n7k2h9IlzACd1od3PLz7jt1MmRj8VyLEJj+Fl5NofTwaH1kphgMoqFAXMFHUwe7B93GuC4VE/qDpOhCn9ja4cIm0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ZxpY2kri; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ZxpY2kri" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-52ce6a9fd5cso1232917e87.3 for ; Mon, 24 Jun 2024 11:54:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719255273; x=1719860073; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=+aHo+RDnT/WvmjPAgH8TsZySNNBozthwDDf/TaQIdEc=; b=ZxpY2kriKXZVCGJgdoDSQUPdPhFdksQytCEp7w+eEaABxzV6A9Bd+fVZa7QkRt3ol8 pLo5u1TwbgcHfoaFv2w8ZxtZIfjP2piHn6vfqstar6RRLVcvdUpMXCc0xUJVSnvV9BAl NbSJanPVrs5YSHSIPkG/r6LsttqfLXrPwayH8lqxpUj86AbX9alQQkRpMCSWMnWIxJYu 0yuU4YaSJjgTylVrqfEoa+9R666y44DTS98Dyjq1dO+zxD0VOKAEbWGONAUxcKDkQDS5 v9rsuvrQVxCbL8WXww7oq8IftuwGpHew8YYRuL/8L8VnQfNLizmw3bLbUdU3nuSm2rpd SZnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719255273; x=1719860073; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+aHo+RDnT/WvmjPAgH8TsZySNNBozthwDDf/TaQIdEc=; b=qYxcubUVYR4N17GbbaEmvUgr7Be8yYWouKllbABb4FAnoBQrhTq14Y5w5wd6o6FX9u hlAzbeVsmNrG8pTf7s/XKnzZpGY7rmUlYg45E7qjYHmSuxTFHGHLlTbsk2w0j4q0+G+g uftUdOV9VTsFwtsuOMrSehSVl1LihVeYY8oLTxo6i4ZhUUVH2mdj5A/pXuqMaE6YC8Zs DHSONFtGVoC8nXNRavorm5c8gFnyrisRt1Bo2rfJvXUECn7VdHyExOlO3dXoilMgdyfN kPV2BMXmaG1H66QxuF955MYiQvPomYc5xB6xs5cmTP5zAyYUdeJOKR3xugyjPxmZe+tr Zv0Q== X-Forwarded-Encrypted: i=1; AJvYcCXdUtyUiMMSKzFa76ZAF8JjlCpJ21Fe69Zp8/tdNDGSzNBpKBuGJY1hZB/A52sERs+yxTnCFSKuFLQs/wFD8RAUn6Mo1+ucgBxQWCez X-Gm-Message-State: AOJu0YxR6C96PbUze5oeM8e8N4T6ShZjnXAdMAocKW8CZ3X10+cxRJyS Wai5Ota4u0O3KchfQPOFvLQjFX3F+ChOnOZ4RV0uMfKAJxMMVWiNoqZN4viFgb8TeeU0aI5yN+i jk10wNLYnCKt7skW3/yY+2V44nVTq3iORmEtQ X-Google-Smtp-Source: AGHT+IG2Ylwf4qP53KT8n9LuQFgtOaFeplGVLRIskw5ThK8EM33Q7t3846sahBbOoJlS7aJZoeVlMm+NykS0UDg32fQ= X-Received: by 2002:a05:6512:1cd:b0:52c:859c:91dd with SMTP id 2adb3069b0e04-52ce18327aamr3287502e87.5.1719255272205; Mon, 24 Jun 2024 11:54:32 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <202406241651.963e3e78-oliver.sang@intel.com> In-Reply-To: From: Yosry Ahmed Date: Mon, 24 Jun 2024 11:53:55 -0700 Message-ID: Subject: Re: [linux-next:master] [mm] 0fa2857d23: WARNING:at_mm/page_alloc.c:#__alloc_pages_noprof To: Usama Arif Cc: Matthew Wilcox , kernel test robot , oe-lkp@lists.linux.dev, lkp@intel.com, Linux Memory Management List , Andrew Morton , Chengming Zhou , Nhat Pham , David Hildenbrand , "Huang, Ying" , Hugh Dickins , Johannes Weiner , Shakeel Butt , Andi Kleen , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jun 24, 2024 at 11:50=E2=80=AFAM Usama Arif wrote: > > > On 24/06/2024 21:33, Matthew Wilcox wrote: > > On Mon, Jun 24, 2024 at 05:05:56AM -0700, Yosry Ahmed wrote: > >> On Mon, Jun 24, 2024 at 1:49=E2=80=AFAM kernel test robot wrote: > >>> kernel test robot noticed "WARNING:at_mm/page_alloc.c:#__alloc_pages_= noprof" on: > >>> > >>> commit: 0fa2857d23aa170e5e28d13c467b303b0065aad8 ("mm: store zero pag= es to be swapped out in a bitmap") > >>> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git mast= er > >> This is coming from WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp), and > >> is triggered by the new bitmap_zalloc() call in the swapon path. For a > >> sufficiently large swapfile, bitmap_zalloc() (which uses kmalloc() > >> under the hood) cannot be used to allocate the bitmap. > > Do we need to use a bitmap? > > > > We could place a special entry in the swapcache instead (there's > > XA_ZERO_ENTRY already defined, and if we need a different entry that's > > not XA_ZERO_ENTRY, there's room for a few hundred more special entries)= . > > I was going for the most space-efficient and simplest data structure, > which is bitmap. I believe xarray is either pointer or integer between 0 > and LONG_MAX? We could convert the individual bits into integer and > store them, and have another function to extract the integer stored in > xarray to a bit, but I think thats basically a separate bitmap_xarray > API (which would probably take more space than a traditional bitmap API, > and I dont want to make this series dependent on something like that), > so I would prefer to use bitmap. I believe Matthew meant reusing the xarray used by the existing swapcache, not adding a new one for this purpose. See my response.