* [PATCH RESEND v6 02/16] mm/gup: Fix __get_user_pages() on fault retry of hugetlb
From: Peter Xu @ 2020-02-20 15:53 UTC (permalink / raw)
To: linux-mm, linux-kernel
Cc: Andrea Arcangeli, Martin Cracauer, Linus Torvalds, Mike Rapoport,
Kirill A . Shutemov, Johannes Weiner, Dr . David Alan Gilbert,
David Hildenbrand, Bobby Powers, Maya Gokhale, Jerome Glisse,
Mike Kravetz, Matthew Wilcox, Marty McFadden, Mel Gorman, peterx,
Hugh Dickins, Brian Geffon, Denis Plotnikov, Pavel Emelyanov
In-Reply-To: <20200220155353.8676-1-peterx@redhat.com>
When follow_hugetlb_page() returns with *locked==0, it means we've got
a VM_FAULT_RETRY within the fauling process and we've released the
mmap_sem. When that happens, we should stop and bail out.
Signed-off-by: Peter Xu <peterx@redhat.com>
---
mm/gup.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/mm/gup.c b/mm/gup.c
index 1b4411bd0042..76cb420c0fb7 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -849,6 +849,16 @@ static long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
i = follow_hugetlb_page(mm, vma, pages, vmas,
&start, &nr_pages, i,
gup_flags, locked);
+ if (locked && *locked == 0) {
+ /*
+ * We've got a VM_FAULT_RETRY
+ * and we've lost mmap_sem.
+ * We must stop here.
+ */
+ BUG_ON(gup_flags & FOLL_NOWAIT);
+ BUG_ON(ret != 0);
+ goto out;
+ }
continue;
}
}
--
2.24.1
^ permalink raw reply related
* [PATCH RESEND v6 01/16] mm/gup: Rename "nonblocking" to "locked" where proper
From: Peter Xu @ 2020-02-20 15:53 UTC (permalink / raw)
To: linux-mm, linux-kernel
Cc: Andrea Arcangeli, Martin Cracauer, Linus Torvalds, Mike Rapoport,
Kirill A . Shutemov, Johannes Weiner, Dr . David Alan Gilbert,
David Hildenbrand, Bobby Powers, Maya Gokhale, Jerome Glisse,
Mike Kravetz, Matthew Wilcox, Marty McFadden, Mel Gorman, peterx,
Hugh Dickins, Brian Geffon, Denis Plotnikov, Pavel Emelyanov
In-Reply-To: <20200220155353.8676-1-peterx@redhat.com>
There's plenty of places around __get_user_pages() that has a parameter
"nonblocking" which does not really mean that "it won't block" (because
it can really block) but instead it shows whether the mmap_sem is
released by up_read() during the page fault handling mostly when
VM_FAULT_RETRY is returned.
We have the correct naming in e.g. get_user_pages_locked() or
get_user_pages_remote() as "locked", however there're still many places
that are using the "nonblocking" as name.
Renaming the places to "locked" where proper to better suite the
functionality of the variable. While at it, fixing up some of the
comments accordingly.
Reviewed-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
mm/gup.c | 44 +++++++++++++++++++++-----------------------
mm/hugetlb.c | 8 ++++----
2 files changed, 25 insertions(+), 27 deletions(-)
diff --git a/mm/gup.c b/mm/gup.c
index 1b521e0ac1de..1b4411bd0042 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -630,12 +630,12 @@ static int get_gate_page(struct mm_struct *mm, unsigned long address,
}
/*
- * mmap_sem must be held on entry. If @nonblocking != NULL and
- * *@flags does not include FOLL_NOWAIT, the mmap_sem may be released.
- * If it is, *@nonblocking will be set to 0 and -EBUSY returned.
+ * mmap_sem must be held on entry. If @locked != NULL and *@flags
+ * does not include FOLL_NOWAIT, the mmap_sem may be released. If it
+ * is, *@locked will be set to 0 and -EBUSY returned.
*/
static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma,
- unsigned long address, unsigned int *flags, int *nonblocking)
+ unsigned long address, unsigned int *flags, int *locked)
{
unsigned int fault_flags = 0;
vm_fault_t ret;
@@ -647,7 +647,7 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma,
fault_flags |= FAULT_FLAG_WRITE;
if (*flags & FOLL_REMOTE)
fault_flags |= FAULT_FLAG_REMOTE;
- if (nonblocking)
+ if (locked)
fault_flags |= FAULT_FLAG_ALLOW_RETRY;
if (*flags & FOLL_NOWAIT)
fault_flags |= FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_RETRY_NOWAIT;
@@ -673,8 +673,8 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma,
}
if (ret & VM_FAULT_RETRY) {
- if (nonblocking && !(fault_flags & FAULT_FLAG_RETRY_NOWAIT))
- *nonblocking = 0;
+ if (locked && !(fault_flags & FAULT_FLAG_RETRY_NOWAIT))
+ *locked = 0;
return -EBUSY;
}
@@ -751,7 +751,7 @@ static int check_vma_flags(struct vm_area_struct *vma, unsigned long gup_flags)
* only intends to ensure the pages are faulted in.
* @vmas: array of pointers to vmas corresponding to each page.
* Or NULL if the caller does not require them.
- * @nonblocking: whether waiting for disk IO or mmap_sem contention
+ * @locked: whether we're still with the mmap_sem held
*
* Returns either number of pages pinned (which may be less than the
* number requested), or an error. Details about the return value:
@@ -786,13 +786,11 @@ static int check_vma_flags(struct vm_area_struct *vma, unsigned long gup_flags)
* appropriate) must be called after the page is finished with, and
* before put_page is called.
*
- * If @nonblocking != NULL, __get_user_pages will not wait for disk IO
- * or mmap_sem contention, and if waiting is needed to pin all pages,
- * *@nonblocking will be set to 0. Further, if @gup_flags does not
- * include FOLL_NOWAIT, the mmap_sem will be released via up_read() in
- * this case.
+ * If @locked != NULL, *@locked will be set to 0 when mmap_sem is
+ * released by an up_read(). That can happen if @gup_flags does not
+ * have FOLL_NOWAIT.
*
- * A caller using such a combination of @nonblocking and @gup_flags
+ * A caller using such a combination of @locked and @gup_flags
* must therefore hold the mmap_sem for reading only, and recognize
* when it's been released. Otherwise, it must be held for either
* reading or writing and will not be released.
@@ -804,7 +802,7 @@ static int check_vma_flags(struct vm_area_struct *vma, unsigned long gup_flags)
static long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
unsigned long start, unsigned long nr_pages,
unsigned int gup_flags, struct page **pages,
- struct vm_area_struct **vmas, int *nonblocking)
+ struct vm_area_struct **vmas, int *locked)
{
long ret = 0, i = 0;
struct vm_area_struct *vma = NULL;
@@ -850,7 +848,7 @@ static long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
if (is_vm_hugetlb_page(vma)) {
i = follow_hugetlb_page(mm, vma, pages, vmas,
&start, &nr_pages, i,
- gup_flags, nonblocking);
+ gup_flags, locked);
continue;
}
}
@@ -868,7 +866,7 @@ static long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
page = follow_page_mask(vma, start, foll_flags, &ctx);
if (!page) {
ret = faultin_page(tsk, vma, start, &foll_flags,
- nonblocking);
+ locked);
switch (ret) {
case 0:
goto retry;
@@ -1129,7 +1127,7 @@ static __always_inline long __get_user_pages_locked(struct task_struct *tsk,
* @vma: target vma
* @start: start address
* @end: end address
- * @nonblocking:
+ * @locked: whether the mmap_sem is still held
*
* This takes care of mlocking the pages too if VM_LOCKED is set.
*
@@ -1137,14 +1135,14 @@ static __always_inline long __get_user_pages_locked(struct task_struct *tsk,
*
* vma->vm_mm->mmap_sem must be held.
*
- * If @nonblocking is NULL, it may be held for read or write and will
+ * If @locked is NULL, it may be held for read or write and will
* be unperturbed.
*
- * If @nonblocking is non-NULL, it must held for read only and may be
- * released. If it's released, *@nonblocking will be set to 0.
+ * If @locked is non-NULL, it must held for read only and may be
+ * released. If it's released, *@locked will be set to 0.
*/
long populate_vma_page_range(struct vm_area_struct *vma,
- unsigned long start, unsigned long end, int *nonblocking)
+ unsigned long start, unsigned long end, int *locked)
{
struct mm_struct *mm = vma->vm_mm;
unsigned long nr_pages = (end - start) / PAGE_SIZE;
@@ -1179,7 +1177,7 @@ long populate_vma_page_range(struct vm_area_struct *vma,
* not result in a stack expansion that recurses back here.
*/
return __get_user_pages(current, mm, start, nr_pages, gup_flags,
- NULL, NULL, nonblocking);
+ NULL, NULL, locked);
}
/*
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index dd8737a94bec..c84f721db020 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -4266,7 +4266,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,
long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
struct page **pages, struct vm_area_struct **vmas,
unsigned long *position, unsigned long *nr_pages,
- long i, unsigned int flags, int *nonblocking)
+ long i, unsigned int flags, int *locked)
{
unsigned long pfn_offset;
unsigned long vaddr = *position;
@@ -4337,7 +4337,7 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
spin_unlock(ptl);
if (flags & FOLL_WRITE)
fault_flags |= FAULT_FLAG_WRITE;
- if (nonblocking)
+ if (locked)
fault_flags |= FAULT_FLAG_ALLOW_RETRY;
if (flags & FOLL_NOWAIT)
fault_flags |= FAULT_FLAG_ALLOW_RETRY |
@@ -4354,9 +4354,9 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
break;
}
if (ret & VM_FAULT_RETRY) {
- if (nonblocking &&
+ if (locked &&
!(fault_flags & FAULT_FLAG_RETRY_NOWAIT))
- *nonblocking = 0;
+ *locked = 0;
*nr_pages = 0;
/*
* VM_FAULT_RETRY must not return an
--
2.24.1
^ permalink raw reply related
* Re: [dpdk-dev] [PATCH v3] examples/tep_term: remove redundant info get
From: David Marchand @ 2020-02-20 15:53 UTC (permalink / raw)
To: Xiaolong Ye; +Cc: dev, Xiaoyun Li, dpdk stable
In-Reply-To: <20200217014115.26572-1-xiaoyun.li@intel.com>
On Mon, Feb 17, 2020 at 2:41 AM Xiaoyun Li <xiaoyun.li@intel.com> wrote:
>
> Removed redundant function call of 'rte_eth_dev_info_get()' since it has
> already been called earlier.
>
> Coverity issue: 349922
> Fixes: 2bb43bd4350a ("examples/tep_term: add TSO offload configuration")
> Cc: stable@dpdk.org
>
> Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
LGTM.
Xiaolong, you had reviewed it before, can you have a look?
Thanks.
--
David Marchand
^ permalink raw reply
* Re: Question about pressure sensor driver data processing
From: Jean-Baptiste Maneyrol @ 2020-02-20 15:51 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-iio
In-Reply-To: <20200219183837.00002aac@Huawei.com>
Hi Jonathan,
I will send first a generic driver returning processed pressure data and raw temperature data and without any buffer/trigger support.
I think this is the most valuable features for this driver.
Afterward, I am interested to add buffer support using hrtimer trigger.
Thanks for your feedback.
JB
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Sent: Wednesday, February 19, 2020 19:38
To: Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
Cc: linux-iio <linux-iio@vger.kernel.org>
Subject: Re: Question about pressure sensor driver data processing
CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe.
On Tue, 18 Feb 2020 15:59:26 +0000
Jean-Baptiste Maneyrol <JManeyrol@invensense.com> wrote:
> Hello,
>
> I have a question concerning a pressure sensor driver I am currently
> writing.
>
> The formula to get the real pressure in Pa for this sensor is quite
> complex. It depends on the measured temperature and would be far
> better done in floats rather than in integers.
>
> The formula is too complex to be expressed with only scale and offset
> factors. And the factors are not fixed since it depends on the
> temperature.
>
> Would it be acceptable to have a driver than returns the raw data
> without processing? Meaning data that have no unit and require a
> processing done in userspace? That would be much more efficient for
> sure, but it would not output really useful data without the
> processing.
Whilst it isn't nice, we have examples where this is already the case.
The heart rate sensors are similar in that they have very complex
conversions.
It is certainly better than being unable to support the driver at all,
but it does mean you won't ever be able to use it with generic code.
Generic code tends to assume the scale is constant as well, so probably
wouldn't work anyway :)
>
> Or a driver that return an input processed data and a raw data that
> have no unit and requires the processing? If we can return raw data,
> we should be able also to add buffer/trigger support to the driver.
> Otherwise that would be quite tricky to return the processed data in
> the buffer.
Hmm. It is messy so if you actually expect to add buffered support, then
we will need special code in userspace for this device anyway.
We do have devices that jump through a complex conversion then pack
it into a buffer, but that is also somewhat of a hack.
For now at least, go with the raw output only. It may be one of those
exceptions where we do support both processed and raw outputs in the
longer term if there is clear need for generic code with this device.
Jonathan
>
> Thanks for your feedback.
> JB
^ permalink raw reply
* Re: [Xen-devel] [PATCH] rwlock: allow recursive read locking when already locked in write mode
From: Jan Beulich @ 2020-02-20 15:52 UTC (permalink / raw)
To: Roger Pau Monné
Cc: Jürgen Groß, Stefano Stabellini, Julien Grall, Wei Liu,
Konrad Rzeszutek Wilk, George Dunlap, Andrew Cooper, Ian Jackson,
xen-devel
In-Reply-To: <20200220152004.GN4679@Air-de-Roger>
On 20.02.2020 16:20, Roger Pau Monné wrote:
> On Thu, Feb 20, 2020 at 04:11:08PM +0100, Jan Beulich wrote:
>> On 20.02.2020 15:38, Roger Pau Monné wrote:
>>> On Thu, Feb 20, 2020 at 03:23:38PM +0100, Jürgen Groß wrote:
>>>> On 20.02.20 15:11, Roger Pau Monné wrote:
>>>>> On Thu, Feb 20, 2020 at 01:48:54PM +0100, Jan Beulich wrote:
>>>>>> On 20.02.2020 13:02, Roger Pau Monne wrote:
>>>>>>> @@ -166,7 +180,8 @@ static inline void _write_unlock(rwlock_t *lock)
>>>>>>> * If the writer field is atomic, it can be cleared directly.
>>>>>>> * Otherwise, an atomic subtraction will be used to clear it.
>>>>>>> */
>>>>>>> - atomic_sub(_QW_LOCKED, &lock->cnts);
>>>>>>> + ASSERT(_is_write_locked_by_me(atomic_read(&lock->cnts)));
>>>>>>> + atomic_sub(_write_lock_val(), &lock->cnts);
>>>>>>
>>>>>> I think this would be more efficient with atomic_and(), not
>>>>>> the least because of the then avoided smp_processor_id().
>>>>>> Whether to mask off just _QW_WMASK or also the CPU number of
>>>>>> the last write owner would need to be determined. But with
>>>>>> using subtraction, in case of problems it'll likely be
>>>>>> harder to understand what actually went on, from looking at
>>>>>> the resulting state of the lock (this is in part a pre-
>>>>>> existing problem, but gets worse with subtraction of CPU
>>>>>> numbers).
>>>>>
>>>>> Right, a mask would be better. Right now both need to be cleared (the
>>>>> LOCKED and the CPU fields) as there's code that relies on !lock->cnts
>>>>> as a way to determine that the lock is not read or write locked. If we
>>>>> left the CPU lying around those checks would need to be adjusted.
>>>>
>>>> In case you make _QR_SHIFT 16 it is possible to just write a 2-byte zero
>>>> value for write_unlock() (like its possible to do so today using a
>>>> single byte write).
>>>
>>> That would limit the readers count to 65536, what do you think Jan?
>>
>> If the recurse_cpu approach is considered bad, I think this would
>> be acceptable. But of course you'll need to consult with the Arm
>> guys regarding the correctness of such a "half" store in their
>> memory model; I would hope this to be universally okay, but I'm
>> not entirely certain.
>
> I would like to get confirmation from the Arm folks, but I see Arm has
> write_atomic and supports such operation against a uint16_t, so I
> don't see why it wouldn't work.
The operations individually being available doesn't mean that
a combination of 32-bit locked accesses and a 16-bit plain
store are going to produce a consistent result. Perhaps I'm
over-cautious here, but I've been bitten by a vaguely similar
issue on x86 back in the ticket lock (in Linux) days.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply
* Re: [igt-dev] [PATCH i-g-t] intel-ci: add a pre-merge blacklist to reduce the testing queue
From: Chris Wilson @ 2020-02-20 15:52 UTC (permalink / raw)
To: Martin Peres, igt-dev
In-Reply-To: <20200220153209.210767-1-martin.peres@linux.intel.com>
Quoting Martin Peres (2020-02-20 15:32:09)
> +###############################################################################
> +# This test virtually never failed, yet is responsible for a relatively big
> +# execution time on some platforms:
> +#
> +# - shard-skl: 1.3% (~3 minutes)
> +# - shard-kbl: 0.3% (~0.3 minutes)
> +# - shard-apl: 0.6% (~1 minute)
> +# - shard-glk: 0.4% (50 seconds)
> +# - shard-icl: 0.1% (15 seconds)
> +# - shard-tgl: 0.1% (15 seconds)
> +#
> +# Data acquired on 2020-02-20 by Martin Peres
> +###############################################################################
> +igt@sw_sync@sync_expired_merge
Change from fixed workload to fixed runtime.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply
* Re: [Intel-gfx] [PATCH v1] drm/i915: Use intel_plane_data_rate for min_cdclk calculation
From: Lisovskiy, Stanislav @ 2020-02-20 15:52 UTC (permalink / raw)
To: ville.syrjala@linux.intel.com
Cc: Nikula, Jani, intel-gfx@lists.freedesktop.org
In-Reply-To: <20200220154311.GD13686@intel.com>
On Thu, 2020-02-20 at 17:43 +0200, Ville Syrjälä wrote:
> On Thu, Feb 20, 2020 at 05:23:47PM +0200, Stanislav Lisovskiy wrote:
> > There seems to be a bit of confusing redundancy in a way, how
> > plane data rate/min cdclk are calculated.
> > In fact both min cdclk, pixel rate and plane data rate are all
> > part of the same formula as per BSpec.
> >
> > However currently we have intel_plane_data_rate, which is used
> > to calculate plane data rate and which is also used in bandwidth
> > calculations. However for calculating min_cdclk we have another
> > piece of code, doing almost same calculation, but a bit differently
> > and in a different place. However as both are actually part of same
> > formula, probably would be wise to use plane data rate calculations
> > as a basis anyway, thus avoiding code duplication and possible bugs
> > related to this.
> >
> > Another thing is that I've noticed that during min_cdclk
> > calculations
> > we account for plane scaling, while for plane data rate, we don't.
> > crtc->pixel_rate seems to account only for pipe ratio, however it
> > is
> > clearly stated in BSpec that plane data rate also need to account
> > plane ratio as well.
> >
> > So what this commit does is:
> > - Adds a plane ratio calculation to intel_plane_data_rate
> > - Removes redundant calculations from skl_plane_min_cdclk which is
> > used for gen9+ and now uses intel_plane_data_rate as a basis from
> > there as well.
> >
> > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> > ---
> > .../gpu/drm/i915/display/intel_atomic_plane.c | 16 ++++++-
> > drivers/gpu/drm/i915/display/intel_sprite.c | 46 +++++++++++--
> > ------
> > 2 files changed, 41 insertions(+), 21 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> > b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> > index c86d7a35c816..702dfa14d112 100644
> > --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> > +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> > @@ -133,15 +133,27 @@ intel_plane_destroy_state(struct drm_plane
> > *plane,
> > kfree(plane_state);
> > }
> >
> > +
> > +
> > unsigned int intel_plane_data_rate(const struct intel_crtc_state
> > *crtc_state,
> > const struct intel_plane_state
> > *plane_state)
> > {
> > const struct drm_framebuffer *fb = plane_state->hw.fb;
> > unsigned int cpp;
> > + unsigned int src_w, src_h, dst_w, dst_h;
> >
> > if (!plane_state->uapi.visible)
> > return 0;
> >
> > + src_w = drm_rect_width(&plane_state->uapi.src) >> 16;
> > + src_h = drm_rect_height(&plane_state->uapi.src) >> 16;
> > + dst_w = drm_rect_width(&plane_state->uapi.dst);
> > + dst_h = drm_rect_height(&plane_state->uapi.dst);
> > +
> > + /* Downscaling limits the maximum pixel rate */
> > + dst_w = min(src_w, dst_w);
> > + dst_h = min(src_h, dst_h);
> > +
> > cpp = fb->format->cpp[0];
> >
> > /*
> > @@ -153,7 +165,9 @@ unsigned int intel_plane_data_rate(const struct
> > intel_crtc_state *crtc_state,
> > if (fb->format->is_yuv && fb->format->num_planes > 1)
> > cpp *= 4;
> >
> > - return cpp * crtc_state->pixel_rate;
> > + return DIV64_U64_ROUND_UP(mul_u32_u32(cpp * crtc_state-
> > >pixel_rate,
> > + src_w * src_h),
> > + mul_u32_u32(dst_w, dst_h));
>
> You don't need a 64bit divisor for this.
>
> > }
> >
> > int intel_plane_calc_min_cdclk(struct intel_atomic_state *state,
> > diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c
> > b/drivers/gpu/drm/i915/display/intel_sprite.c
> > index 7abeefe8dce5..75afb78ff1b0 100644
> > --- a/drivers/gpu/drm/i915/display/intel_sprite.c
> > +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
> > @@ -330,24 +330,34 @@ bool icl_is_hdr_plane(struct drm_i915_private
> > *dev_priv, enum plane_id plane_id)
> > }
> >
> > static void
> > -skl_plane_ratio(const struct intel_crtc_state *crtc_state,
> > - const struct intel_plane_state *plane_state,
> > - unsigned int *num, unsigned int *den)
> > +skl_plane_bpp_constraints(const struct intel_crtc_state
> > *crtc_state,
> > + const struct intel_plane_state *plane_state,
> > + unsigned int *num, unsigned int *den)
> > {
> > struct drm_i915_private *dev_priv = to_i915(plane_state-
> > >uapi.plane->dev);
> > const struct drm_framebuffer *fb = plane_state->hw.fb;
> > + unsigned int cpp = fb->format->cpp[0];
> > +
> > + /*
> > + * Based on HSD#:1408715493
> > + * NV12 cpp == 4, P010 cpp == 8
> > + *
> > + * FIXME what is the logic behind this?
> > + */
> > + if (fb->format->is_yuv && fb->format->num_planes > 1)
> > + cpp *= 4;
>
> This is ugly. I think we need a plane pixel rate instead of
> abusing the data rate as the pixel rate like this.
Yeah, agree, but that is all because of this HSD#-something workaround,
which is preventing to use plane_data_rate in a formula "as is".
Was almost sure that this part is questionable. Probably the best
way would be to extract some function like you say to calculate
per-plane pixel rate, which would be used in both intel_plane_data_rate
and skl_calc_min_cdclk.
The thing what I just aim to eliminate is a duplication on this matter.
I mean if we really calculate it as per BSpec it should be
Plane data rate = Pixel rate * bpp * plane scale ratio * pipe scale
ratio
For recent Gens Pixel rate = Min CDCLK / 2, so all of those are
obviously part of same formula, same should be in the code.
Stan
>
> >
> > if (fb->format->cpp[0] == 8) {
> > if (INTEL_GEN(dev_priv) >= 10 ||
> > IS_GEMINILAKE(dev_priv)) {
> > *num = 10;
> > - *den = 8;
> > + *den = 8 * cpp;
> > } else {
> > *num = 9;
> > - *den = 8;
> > + *den = 8 * cpp;
> > }
> > } else {
> > *num = 1;
> > - *den = 1;
> > + *den = cpp;
> > }
> > }
> >
> > @@ -355,27 +365,23 @@ static int skl_plane_min_cdclk(const struct
> > intel_crtc_state *crtc_state,
> > const struct intel_plane_state
> > *plane_state)
> > {
> > struct drm_i915_private *dev_priv = to_i915(plane_state-
> > >uapi.plane->dev);
> > - unsigned int pixel_rate = crtc_state->pixel_rate;
> > - unsigned int src_w, src_h, dst_w, dst_h;
> > unsigned int num, den;
> > + struct intel_plane *plane = to_intel_plane(plane_state-
> > >uapi.plane);
> >
> > - skl_plane_ratio(crtc_state, plane_state, &num, &den);
> > + skl_plane_bpp_constraints(crtc_state, plane_state, &num, &den);
> >
> > /* two pixels per clock on glk+ */
> > if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
> > den *= 2;
> >
> > - src_w = drm_rect_width(&plane_state->uapi.src) >> 16;
> > - src_h = drm_rect_height(&plane_state->uapi.src) >> 16;
> > - dst_w = drm_rect_width(&plane_state->uapi.dst);
> > - dst_h = drm_rect_height(&plane_state->uapi.dst);
> > -
> > - /* Downscaling limits the maximum pixel rate */
> > - dst_w = min(src_w, dst_w);
> > - dst_h = min(src_h, dst_h);
> > -
> > - return DIV64_U64_ROUND_UP(mul_u32_u32(pixel_rate * num, src_w *
> > src_h),
> > - mul_u32_u32(den, dst_w * dst_h));
> > + /*
> > + * intel_atomic_check_planes has already been called by this
> > + * time in intel_atomic_check, so use calculated plane
> > + * data rate as a basis, in order not to have duplicate code.
> > + * According to BSpec, plane data rate is anyway used as
> > + * a basis for this calculation.
> > + */
> > + return DIV64_U64_ROUND_UP(crtc_state->data_rate[plane->id] *
> > num, den);
> > }
> >
> > static unsigned int
> > --
> > 2.24.1.485.gad05a3d8e5
>
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* Re: [PATCH RFC] Toggle fifo write clk after ungating sdcc clk
From: Bjorn Andersson @ 2020-02-20 15:51 UTC (permalink / raw)
To: Sayali Lokhande
Cc: adrian.hunter, robh+dt, ulf.hansson, asutoshd, stummala, ppvk,
rampraka, vbadigan, sboyd, georgi.djakov, mka, linux-mmc,
linux-kernel, linux-arm-msm, devicetree, agross, linux-mmc-owner
In-Reply-To: <1582190446-4778-1-git-send-email-sayalil@codeaurora.org>
On Thu 20 Feb 01:20 PST 2020, Sayali Lokhande wrote:
> During GCC level clock gating of MCLK, the async FIFO
> gets into some hang condition, such that for the next
> transfer after MCLK ungating, first bit of CMD response
> doesn't get written in to the FIFO. This cause the CPSM
> to hang eventually leading to SW timeout.
>
> To fix the issue, toggle the FIFO write clock after
> MCLK ungated to get the FIFO pointers and flags to
> valid states.
>
Please don't provide cover letters for a single patch.
Regards,
Bjorn
> Ram Prakash Gupta (1):
> mmc: sdhci-msm: Toggle fifo write clk after ungating sdcc clk
>
> drivers/mmc/host/sdhci-msm.c | 43 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
>
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
^ permalink raw reply
* Re: w83627ehf crash in 5.6.0-rc2-00055-gca7e1fd1026c
From: Dr. David Alan Gilbert @ 2020-02-20 15:52 UTC (permalink / raw)
To: Guenter Roeck; +Cc: Meelis Roos, linux-hwmon, LKML, Chen Zhou
In-Reply-To: <ad023dc1-1878-dcd9-a183-06003ed698af@roeck-us.net>
* Guenter Roeck (linux@roeck-us.net) wrote:
> On 2/20/20 5:57 AM, Dr. David Alan Gilbert wrote:
> > * Meelis Roos (mroos@linux.ee) wrote:
> > > > It looks like not all chips have temp_label, so I think we need to change w83627ehf_is_visible
> > > > which has:
> > > >
> > > > if (attr == hwmon_temp_input || attr == hwmon_temp_label)
> > > > return 0444;
> > > >
> > > > to
> > > > if (attr == hwmon_temp_input)
> > > > return 0444;
> > > > if (attr == hwmon_temp_label) {
> > > > if (data->temp_label)
> > > > return 0444;
> > > > else
> > > > return 0;
>
> Nitpick: else after return isn't necessary. Too bad I didn't notice that before;
> static analyzers will have a field day :-)
>
> > > > }
> > > >
> > > > Does that work for you?
> > > Yes, it works - sensors are displayed as they should be, with nothing in dmesg.
> > >
> > > Thank you for so quick response!
> >
> > Great, I need to turn that into a proper patch; (I might need to wait till
> > Saturday for that, although if someone needs it before then please shout).
> >
>
> We'll want this fixed in the next stable release candidate, so I wrote one up
> and submitted it.
Thanks!
Dave
> Thanks,
> Guenter
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ dave @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
^ permalink raw reply
* Re: [PATCH 2/2] watchdog: Add new arm_smc_wdt watchdog driver
From: Guenter Roeck @ 2020-02-20 15:52 UTC (permalink / raw)
To: Evan Benn
Cc: Rob Herring, Wim Van Sebroeck, linux-watchdog, Anson Huang,
Dinh Nguyen, Catalin Marinas, LKML, Shawn Guo, Bjorn Andersson,
Marcin Juszkiewicz, Olof Johansson, Clément Péron,
Greg Kroah-Hartman, Jonathan Cameron, Mauro Carvalho Chehab,
Julius Werner, Leonard Crestez, Will Deacon, David S. Miller,
linux-arm-kernel
In-Reply-To: <CAKz_xw0fHgVBLdEoEoQ7OSAgBcvYBAowV0obWLsDUGNPotP55Q@mail.gmail.com>
On Thu, Feb 20, 2020 at 05:50:03PM +1100, Evan Benn wrote:
> > > + if ((int)res->a0 == PSCI_RET_NOT_SUPPORTED)
> > > + return -ENOTSUPP;
> >
> > -ENODEV would be better here.
> >
> > > + if ((int)res->a0 == PSCI_RET_INVALID_PARAMS)
> > > + return -EINVAL;
> > > + if ((int)res->a0 < 0)
> > > + return -EIO;
>
> In fixing this I found drivers/firmware/psci/psci.c:145
> Which also translates psci codes to errno codes, but uses EOPNOTSUPP:
>
> switch (errno) {
> case PSCI_RET_SUCCESS:
> return 0;
> case PSCI_RET_NOT_SUPPORTED:
> return -EOPNOTSUPP;
> case PSCI_RET_INVALID_PARAMS:
> case PSCI_RET_INVALID_ADDRESS:
> return -EINVAL;
> case PSCI_RET_DENIED:
> return -EPERM;
> };
>
> return -EINVAL;
>
> Are these more appropriate?
>
It is customary for driver probe functions to return -ENODEV if the
device is not supported. I don't see a reason why this driver should
behave any different. "but this other driver does it" is never a good
argument.
Having said that, yet, with the exception of -EOPNOTSUPP the other
return values would be more appropriate.
Guenter
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH 2/2] watchdog: Add new arm_smc_wdt watchdog driver
From: Guenter Roeck @ 2020-02-20 15:52 UTC (permalink / raw)
To: Evan Benn
Cc: LKML, Julius Werner, Bjorn Andersson, Mauro Carvalho Chehab,
Marcin Juszkiewicz, Catalin Marinas, Olof Johansson,
Leonard Crestez, Jonathan Cameron, Dinh Nguyen, linux-arm-kernel,
Greg Kroah-Hartman, Will Deacon, linux-watchdog, Rob Herring,
Wim Van Sebroeck, Clément Péron, Shawn Guo,
David S. Miller, Anson Huang
In-Reply-To: <CAKz_xw0fHgVBLdEoEoQ7OSAgBcvYBAowV0obWLsDUGNPotP55Q@mail.gmail.com>
On Thu, Feb 20, 2020 at 05:50:03PM +1100, Evan Benn wrote:
> > > + if ((int)res->a0 == PSCI_RET_NOT_SUPPORTED)
> > > + return -ENOTSUPP;
> >
> > -ENODEV would be better here.
> >
> > > + if ((int)res->a0 == PSCI_RET_INVALID_PARAMS)
> > > + return -EINVAL;
> > > + if ((int)res->a0 < 0)
> > > + return -EIO;
>
> In fixing this I found drivers/firmware/psci/psci.c:145
> Which also translates psci codes to errno codes, but uses EOPNOTSUPP:
>
> switch (errno) {
> case PSCI_RET_SUCCESS:
> return 0;
> case PSCI_RET_NOT_SUPPORTED:
> return -EOPNOTSUPP;
> case PSCI_RET_INVALID_PARAMS:
> case PSCI_RET_INVALID_ADDRESS:
> return -EINVAL;
> case PSCI_RET_DENIED:
> return -EPERM;
> };
>
> return -EINVAL;
>
> Are these more appropriate?
>
It is customary for driver probe functions to return -ENODEV if the
device is not supported. I don't see a reason why this driver should
behave any different. "but this other driver does it" is never a good
argument.
Having said that, yet, with the exception of -EOPNOTSUPP the other
return values would be more appropriate.
Guenter
^ permalink raw reply
* Re: [Xen-devel] [PATCH] rwlock: allow recursive read locking when already locked in write mode
From: Jan Beulich @ 2020-02-20 15:50 UTC (permalink / raw)
To: Roger Pau Monné
Cc: Jürgen Groß, Stefano Stabellini, Julien Grall, Wei Liu,
Konrad Rzeszutek Wilk, George Dunlap, Andrew Cooper, Ian Jackson,
xen-devel
In-Reply-To: <20200220151734.GM4679@Air-de-Roger>
On 20.02.2020 16:17, Roger Pau Monné wrote:
> On Thu, Feb 20, 2020 at 04:02:55PM +0100, Jan Beulich wrote:
>> On 20.02.2020 15:11, Roger Pau Monné wrote:
>>> On Thu, Feb 20, 2020 at 01:48:54PM +0100, Jan Beulich wrote:
>>>> Another option is to use the recurse_cpu field of the
>>>> associated spin lock: The field is used for recursive locks
>>>> only, and hence the only conflict would be with
>>>> _spin_is_locked(), which we don't (and in the future then
>>>> also shouldn't) use on this lock.
>>>
>>> I looked into that also, but things get more complicated AFAICT, as it's
>>> not possible to atomically fetch the state of the lock and the owner
>>> CPU at the same time. Neither you could set the LOCKED bit and the CPU
>>> at the same time.
>>
>> There's no need to atomically fetch both afaics: The field is
>> valid only if the LOCKED bit is set. And when reading the
>> field you only care about the value being equal to
>> smp_processor_id(), i.e. it is fine to set LOCKED before
>> updating the CPU field on lock, and to reset the CPU field to
>> SPINLOCK_NO_CPU (or whatever it's called) before clearing
>> LOCKED.
>
> Yes that would require the usage of a sentinel value as 0 would be a
> valid processor ID.
>
> I would try to refrain from (abu)sing internal spinlock fields, as I
> think we can solve this just by using the cnts field on the current
> rwlock implementation.
>
> What issue do you have in mind that would prevent storing the CPU
> write locked in the cnts field?
The reduction of the number of bits used for other purposes.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply
* Re: [PATCH 01/19] vfs: syscall: Add fsinfo() to query filesystem information [ver #16]
From: Darrick J. Wong @ 2020-02-20 15:48 UTC (permalink / raw)
To: David Howells
Cc: viro, raven, mszeredi, christian, linux-api, linux-fsdevel,
linux-kernel
In-Reply-To: <542411.1582194875@warthog.procyon.org.uk>
On Thu, Feb 20, 2020 at 10:34:35AM +0000, David Howells wrote:
> Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> > > + p->f_blocks.hi = 0;
> > > + p->f_blocks.lo = buf.f_blocks;
> >
> > Er... are there filesystems (besides that (xfs++)++ one) that require
> > u128 counters? I suspect that the Very Large Fields are for future
> > expandability, but I also wonder about the whether it's worth the
> > complexity of doing this, since the structures can always be
> > version-revved later.
>
> I'm making a relatively cheap allowance for future expansion. Dave Chinner
> has mentioned at one of the LSFs that 16EiB may be exceeded soon (though I
> hate to think of fscking such a beastie). I know that the YFS variant of AFS
> supports 96-bit vnode numbers (which I translate to inode numbers). What I'm
Aha, you /already/ have a use for larger-than-64bit numbers. Got it. :)
> trying to avoid is the problem we have with stat/statfs where under some
> circumstances we have to return an error (ERANGE?) because we can't represent
> the number if someone asks for an older version of the struct.
>
> Since the buffer is (meant to be) pre-cleared, the filesystem can just ignore
> the high word if it's never going to set it. In fact, fsinfo_generic_statfs
> doesn't need to set them either.
>
> > XFS inodes are u64 values...
> > ...and the max symlink target length is 1k, not PAGE_SIZE...
>
> Yeah, and AFS(YFS) has 96-bit inode numbers. The filesystem's fsinfo table is
> read first so that the filesystem can override this.
>
> > ...so is the usage model here that XFS should call fsinfo_generic_limits
> > to fill out the fsinfo_limits structure, modify the values in
> > ctx->buffer as appropriate for XFS, and then return the structure size?
>
> Actually, I should export some these so that you can do that. I'll export
> fsinfo_generic_{timestamp_info,supports,limits} for now.
Thank you.
> > > +#define FSINFO_ATTR_VOLUME_ID 0x05 /* Volume ID (string) */
> > > +#define FSINFO_ATTR_VOLUME_UUID 0x06 /* Volume UUID (LE uuid) */
> > > +#define FSINFO_ATTR_VOLUME_NAME 0x07 /* Volume name (string) */
> >
> > I think I've muttered about the distinction between volume id and
> > volume name before, but I'm still wondering how confusing that will be
> > for users? Let me check my assumptions, though:
> >
> > Volume ID is whatever's in super_block.s_id, which (at least for xfs and
> > ext4) is the device name (e.g. "sda1"). I guess that's useful for
> > correlating a thing you can call fsinfo() on against strings that were
> > logged in dmesg.
> >
> > Volume name I think is the fs label (e.g. "home"), which I think will
> > have to be implemented separately by each filesystem, and that's why
> > there's no generic vfs implementation.
>
> Yes. For AFS, for example, this would be the name of the volume (which may be
> changed), whereas the volume ID is the number in the protocol that actually
> refers to the volume (which cannot be changed).
>
> And, as you say, for blockdev mounts, the ID is the device name and the volume
> name is filesystem specific.
>
> > The 7 -> 0 -> 1 sequence here confused me until I figured out that
> > QUERY_TYPE is the mask for QUERY_{PATH,FD}.
>
> Changed to FSINFO_FLAGS_QUERY_MASK.
>
> > > +struct fsinfo_limits {
> > > +...
> > > + __u32 __reserved[1];
> >
> > I wonder if these structures ought to reserve more space than a single u32...
>
> No need. Part of the way the interface is designed is that the version number
> for a particular VSTRUCT-type attribute is also the length. So a newer
> version is also longer. All the old fields must be retained and filled in.
> New fields are tagged on the end.
>
> If userspace asks for an older version than is supported, it gets a truncated
> return. If it asks for a newer version, the extra fields it is expecting are
> all set to 0. Either way, the length (and thus the version) the kernel
> supports is returned - not the length copied.
>
> The __reserved fields are there because they represent padding (the struct is
> going to be aligned/padded according to __u64 in this case). Ideally, I'd
> mark the structs __packed, but this messes with the alignment and may make the
> compiler do funny tricks to get out any field larger than a byte.
>
> I've renamed them to __padding.
>
> > > +struct fsinfo_supports {
> > > + __u64 stx_attributes; /* What statx::stx_attributes are supported */
> > > + __u32 stx_mask; /* What statx::stx_mask bits are supported */
> > > + __u32 ioc_flags; /* What FS_IOC_* flags are supported */
> >
> > "IOC"? That just means 'ioctl'. Is this field supposed to return the
> > supported FS_IOC_GETFLAGS flags, or the supported FS_IOC_FSGETXATTR
> > flags?
>
> FS_IOC_[GS]ETFLAGS is what I meant.
>
> > I suspect it would also be a big help to be able to tell userspace which
> > of the flags can be set, and which can be cleared.
>
> How about:
>
> __u32 fs_ioc_getflags; /* What FS_IOC_GETFLAGS may return */
> __u32 fs_ioc_setflags_set; /* What FS_IOC_SETFLAGS may set */
> __u32 fs_ioc_setflags_clear; /* What FS_IOC_SETFLAGS may clear */
Looks good to me. At some point it'll be good to add another fsinfo
verb or something to query exactly what parts of struct fsxattr can be
set, cleared, or returned, but that can wait.
> > > +struct fsinfo_timestamp_one {
> > > + __s64 minimum; /* Minimum timestamp value in seconds */
> > > + __u64 maximum; /* Maximum timestamp value in seconds */
> >
> > Given that time64_t is s64, why is the maximum here u64?
>
> Well, I assume it extremely unlikely that the maximum can be before 1970, so
> there doesn't seem any need to allow the maximum to be negative. Furthermore,
> it would be feasible that you could encounter a filesystem with a u64
> filesystem that doesn't support dates before 1970.
>
> On the other hand, if Linux is still going when __s64 seconds from 1970 wraps,
> it will be impressive, but I'm not sure we'll be around to see it... Someone
> will have to cast a resurrection spell on Arnd to fix that one.
I fear we /all/ will be around, having forcibly been uploaded to The
Cloud because nobody else knows how to maintain the Linux kernel, and we
can't have the drinks dispenser on B deck going bonkers twice per stardate.
(j/k)
> However, since signed/unsigned comparisons may have issues, I can turn it into
> an __s64 also if that is preferred.
It /would/ be more consistent with the rest of the kernel, and since the
kernel & userspace don't support timestamps beyond 8Es, there's no point
in advertising a maximum beyond that.
--D
> David
>
^ permalink raw reply
* Re: Filesystem corruption after unreachable storage
From: Theodore Y. Ts'o @ 2020-02-20 15:50 UTC (permalink / raw)
To: Jean-Louis Dupond; +Cc: linux-ext4
In-Reply-To: <3a7bc899-31d9-51f2-1ea9-b3bef2a98913@dupond.be>
On Thu, Feb 20, 2020 at 10:08:44AM +0100, Jean-Louis Dupond wrote:
> dumpe2fs -> see attachment
Looking at the dumpe2fs output, it's interesting that it was "clean
with errors", without any error information being logged in the
superblock. What version of the kernel are you using? I'm guessing
it's a fairly old one?
> Fsck:
> # e2fsck -fy /dev/mapper/vg01-root
> e2fsck 1.44.5 (15-Dec-2018)
And that's a old version of e2fsck as well. Is this some kind of
stable/enterprise linux distro?
> Pass 1: Checking inodes, blocks, and sizes
> Inodes that were part of a corrupted orphan linked list found. Fix? yes
>
> Inode 165708 was part of the orphaned inode list. FIXED.
OK, this and the rest looks like it's relating to a file truncation or
deletion at the time of the disconnection.
> > > On KVM for example there is a unlimited timeout (afaik) until the
> > > storage is
> > > back, and the VM just continues running after storage recovery.
> > Well, you can adjust the SCSI timeout, if you want to give that a try....
> It has some other disadvantages? Or is it quite safe to increment the SCSI
> timeout?
It should be pretty safe.
Can you reliably reproduce the problem by disconnecting the machine
from the SAN?
- Ted
^ permalink raw reply
* Re: [cip-dev] [PATCH 4.19.y-cip 17/23] usb: typec: add dependency for TYPEC_HD3SS3220
From: Pavel Machek @ 2020-02-20 15:50 UTC (permalink / raw)
To: Marian-Cristian Rotariu; +Cc: cip-dev@lists.cip-project.org
In-Reply-To: <OSAPR01MB5028AA819CCF2EF35A68E18AAE130@OSAPR01MB5028.jpnprd01.prod.outlook.com>
[-- Attachment #1.1: Type: text/plain, Size: 1944 bytes --]
Hi!
> > On Tue 2020-02-18 14:05:14, Marian-Cristian Rotariu wrote:
> > > From: Mao Wenan <maowenan@huawei.com>
> > >
> > > commit da4b5d18dd949abdda7c8ea76c9483b5edd49616 upstream.
> > >
> > > If CONFIG_TYPEC_HD3SS3220=y, CONFIG_USB_ROLE_SWITCH=m, below
> > errors
> > > can be found:
> > > drivers/usb/typec/hd3ss3220.o: In function `hd3ss3220_remove':
> > > hd3ss3220.c:(.text+0x64): undefined reference to `usb_role_switch_put'
> > > drivers/usb/typec/hd3ss3220.o: In function `hd3ss3220_dr_set':
> > > hd3ss3220.c:(.text+0x154): undefined reference to
> > `usb_role_switch_set_role'
> > > drivers/usb/typec/hd3ss3220.o: In function `hd3ss3220_set_role':
> > > hd3ss3220.c:(.text+0x294): undefined reference to
> > `usb_role_switch_set_role'
> > > hd3ss3220.c:(.text+0x2f4): undefined reference to
> > `usb_role_switch_set_role'
> > > hd3ss3220.c:(.text+0x348): undefined reference to
> > `usb_role_switch_set_role'
> > > hd3ss3220.c:(.text+0x390): undefined reference to
> > `usb_role_switch_set_role'
> > > drivers/usb/typec/hd3ss3220.o: In function `hd3ss3220_probe':
> > > hd3ss3220.c:(.text+0x5e8): undefined reference to
> > `fwnode_usb_role_switch_get'
> > > hd3ss3220.c:(.text+0x8a4): undefined reference to `usb_role_switch_put'
> > > make: *** [vmlinux] Error 1
> >
> > I guess it is okay here, but for more serious bugs it would be nice to merge
> > the buggy patch with a fix -- not to break bisect.
>
> I kind of forgot about bisect. I was mostly focused on keeping the original patches
> from upstream (in this case, it is more about the commit message as the fix is trivial).
> I will send this patch in v2 also, since you mostly agreed with it. Please let me know
> if otherwise.
This patch is okay.
Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
cip-dev mailing list
cip-dev@lists.cip-project.org
https://lists.cip-project.org/mailman/listinfo/cip-dev
^ permalink raw reply
* Re: [igt-dev] [PATCH i-g-t] intel-ci: add a pre-merge blacklist to reduce the testing queue
From: Chris Wilson @ 2020-02-20 15:50 UTC (permalink / raw)
To: Martin Peres, igt-dev
In-Reply-To: <20200220153209.210767-1-martin.peres@linux.intel.com>
Quoting Martin Peres (2020-02-20 15:32:09)
> +###############################################################################
> +# This tests modesetting-vs-wedged which is a useful thing to check, but it
> +# seems like it mostly catches unrelated issues which are better caught by
> +# other tests.
> +#
> +# - shard-skl: 0.5% (~1 minute)
> +# - shard-kbl: 1% (~1 minute)
> +# - shard-apl: 0.6% (~1 minute)
> +# - shard-glk: 0.5% (~1 minute)
> +# - shard-icl: 0.6% (~1.5 minutes)
> +# - shard-tgl: 0.7% (~1.5 minutes)
> +#
> +# Data acquired on 2020-02-20 by Martin Peres
> +###############################################################################
> +igt@gem_eio@kms
Hah. It caught novel issues, which have not been split out into separate
regression tests.
Making sure kms is robust is not a bad thing; you can easily speed this
up by reducing the workload.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply
* Re: [PATCH 1/8] btrfs: make the extent buffer leak check per fs info
From: Josef Bacik @ 2020-02-20 15:49 UTC (permalink / raw)
To: Nikolay Borisov, linux-btrfs, kernel-team
In-Reply-To: <78ac92dc-1e57-1d74-0b17-48832a36c649@suse.com>
On 2/19/20 8:59 AM, Nikolay Borisov wrote:
>
>
> On 14.02.20 г. 23:11 ч., Josef Bacik wrote:
>> I'm going to make the entire destruction of btrfs_root's controlled by
>> their refcount, so it will be helpful to notice if we're leaking their
>> eb's on umount.
>>
>> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
>
> Overall looks good, one minor nit below though:
>
>> ---
>> fs/btrfs/ctree.h | 3 +++
>> fs/btrfs/disk-io.c | 3 +++
>> fs/btrfs/extent_io.c | 45 ++++++++++++++++++++++----------------------
>> fs/btrfs/extent_io.h | 7 +++++++
>> 4 files changed, 36 insertions(+), 22 deletions(-)
>>
>
> <snip>
>
>> @@ -35,42 +35,45 @@ static inline bool extent_state_in_tree(const struct extent_state *state)
>> }
>>
>> #ifdef CONFIG_BTRFS_DEBUG
>> -static LIST_HEAD(buffers);
>> static LIST_HEAD(states);
>> -
>> static DEFINE_SPINLOCK(leak_lock);
>
> This lock should be renamed to extent_state_leak_lock, otherwise it's
> not clear what it protects. I had to through its usage to figure it out.
> To take this further, why don't you make it a a per-fs_info lock as
> well? Extent states are per fs themselves.
>
Yeah I can follow up once this set is merged. Thanks,
Josef
^ permalink raw reply
* Re: [PATCH] selftest/lkdtm: Don't pollute 'git status'
From: Shuah Khan @ 2020-02-20 15:49 UTC (permalink / raw)
To: Christophe Leroy, Kees Cook
Cc: linux-mm, linuxppc-dev, linux-kernel, Shuah Khan,
open list:KERNEL SELFTEST FRAMEWORK
In-Reply-To: <ca71e490-b4fa-bf53-7a60-b6954b9dd33e@c-s.fr>
On 2/20/20 7:58 AM, Christophe Leroy wrote:
> ping
>
> On 02/06/2020 08:11 AM, Christophe Leroy wrote:
>> Commit 46d1a0f03d66 ("selftests/lkdtm: Add tests for LKDTM targets")
>> added generation of lkdtm test scripts.
>>
>> Ignore those generated scripts when performing 'git status'
>>
>> Fixes: 46d1a0f03d66 ("selftests/lkdtm: Add tests for LKDTM targets")
>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>
> Without this, 'git status' now reports the following crap and real
> problems are drowned in the middle, that's annoying.
>
I will pull this in. Please cc linux-kselftest mailing list in the
future.
thanks,
-- Shuah
^ permalink raw reply
* Re: [PATCH v7 22/24] iomap: Convert from readpages to readahead
From: Christoph Hellwig @ 2020-02-20 15:49 UTC (permalink / raw)
To: Matthew Wilcox
Cc: linux-xfs, linux-kernel, linux-f2fs-devel, cluster-devel,
linux-mm, ocfs2-devel, linux-fsdevel, linux-ext4, linux-erofs,
linux-btrfs
In-Reply-To: <20200219210103.32400-23-willy@infradead.org>
On Wed, Feb 19, 2020 at 01:01:01PM -0800, Matthew Wilcox wrote:
> From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
>
> Use the new readahead operation in iomap. Convert XFS and ZoneFS to
> use it.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
> fs/iomap/buffered-io.c | 90 +++++++++++++++---------------------------
> fs/iomap/trace.h | 2 +-
> fs/xfs/xfs_aops.c | 13 +++---
> fs/zonefs/super.c | 7 ++--
> include/linux/iomap.h | 3 +-
> 5 files changed, 41 insertions(+), 74 deletions(-)
>
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index 31899e6cb0f8..66cf453f4bb7 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -214,9 +214,8 @@ iomap_read_end_io(struct bio *bio)
> struct iomap_readpage_ctx {
> struct page *cur_page;
> bool cur_page_in_bio;
> - bool is_readahead;
> struct bio *bio;
> - struct list_head *pages;
> + struct readahead_control *rac;
> };
>
> static void
> @@ -307,11 +306,11 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
> if (ctx->bio)
> submit_bio(ctx->bio);
>
> - if (ctx->is_readahead) /* same as readahead_gfp_mask */
> + if (ctx->rac) /* same as readahead_gfp_mask */
> gfp |= __GFP_NORETRY | __GFP_NOWARN;
> ctx->bio = bio_alloc(gfp, min(BIO_MAX_PAGES, nr_vecs));
> ctx->bio->bi_opf = REQ_OP_READ;
> - if (ctx->is_readahead)
> + if (ctx->rac)
> ctx->bio->bi_opf |= REQ_RAHEAD;
> ctx->bio->bi_iter.bi_sector = sector;
> bio_set_dev(ctx->bio, iomap->bdev);
> @@ -367,36 +366,8 @@ iomap_readpage(struct page *page, const struct iomap_ops *ops)
> }
> EXPORT_SYMBOL_GPL(iomap_readpage);
>
> -static struct page *
> -iomap_next_page(struct inode *inode, struct list_head *pages, loff_t pos,
> - loff_t length, loff_t *done)
> -{
> - while (!list_empty(pages)) {
> - struct page *page = lru_to_page(pages);
> -
> - if (page_offset(page) >= (u64)pos + length)
> - break;
> -
> - list_del(&page->lru);
> - if (!add_to_page_cache_lru(page, inode->i_mapping, page->index,
> - GFP_NOFS))
> - return page;
> -
> - /*
> - * If we already have a page in the page cache at index we are
> - * done. Upper layers don't care if it is uptodate after the
> - * readpages call itself as every page gets checked again once
> - * actually needed.
> - */
> - *done += PAGE_SIZE;
> - put_page(page);
> - }
> -
> - return NULL;
> -}
> -
> static loff_t
> -iomap_readpages_actor(struct inode *inode, loff_t pos, loff_t length,
> +iomap_readahead_actor(struct inode *inode, loff_t pos, loff_t length,
> void *data, struct iomap *iomap, struct iomap *srcmap)
> {
> struct iomap_readpage_ctx *ctx = data;
> @@ -404,10 +375,7 @@ iomap_readpages_actor(struct inode *inode, loff_t pos, loff_t length,
>
> while (done < length) {
> if (!ctx->cur_page) {
> - ctx->cur_page = iomap_next_page(inode, ctx->pages,
> - pos, length, &done);
> - if (!ctx->cur_page)
> - break;
> + ctx->cur_page = readahead_page(ctx->rac);
> ctx->cur_page_in_bio = false;
> }
> ret = iomap_readpage_actor(inode, pos + done, length - done,
> @@ -431,44 +399,48 @@ iomap_readpages_actor(struct inode *inode, loff_t pos, loff_t length,
> return done;
> }
>
> -int
> -iomap_readpages(struct address_space *mapping, struct list_head *pages,
> - unsigned nr_pages, const struct iomap_ops *ops)
> +/**
> + * iomap_readahead - Attempt to read pages from a file.
> + * @rac: Describes the pages to be read.
> + * @ops: The operations vector for the filesystem.
> + *
> + * This function is for filesystems to call to implement their readahead
> + * address_space operation.
> + *
> + * Context: The file is pinned by the caller, and the pages to be read are
> + * all locked and have an elevated refcount. This function will unlock
> + * the pages (once I/O has completed on them, or I/O has been determined to
> + * not be necessary). It will also decrease the refcount once the pages
> + * have been submitted for I/O. After this point, the page may be removed
> + * from the page cache, and should not be referenced.
> + */
Isn't the context documentation something that belongs into the aop
documentation? I've never really seen the value of duplicating this
information in method instances, as it is just bound to be out of date
rather sooner than later.
^ permalink raw reply
* Re: [PATCH v7 22/24] iomap: Convert from readpages to readahead
From: Christoph Hellwig @ 2020-02-20 15:49 UTC (permalink / raw)
To: Matthew Wilcox
Cc: linux-fsdevel, linux-mm, linux-kernel, linux-btrfs, linux-erofs,
linux-ext4, linux-f2fs-devel, cluster-devel, ocfs2-devel,
linux-xfs
In-Reply-To: <20200219210103.32400-23-willy@infradead.org>
On Wed, Feb 19, 2020 at 01:01:01PM -0800, Matthew Wilcox wrote:
> From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
>
> Use the new readahead operation in iomap. Convert XFS and ZoneFS to
> use it.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
> fs/iomap/buffered-io.c | 90 +++++++++++++++---------------------------
> fs/iomap/trace.h | 2 +-
> fs/xfs/xfs_aops.c | 13 +++---
> fs/zonefs/super.c | 7 ++--
> include/linux/iomap.h | 3 +-
> 5 files changed, 41 insertions(+), 74 deletions(-)
>
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index 31899e6cb0f8..66cf453f4bb7 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -214,9 +214,8 @@ iomap_read_end_io(struct bio *bio)
> struct iomap_readpage_ctx {
> struct page *cur_page;
> bool cur_page_in_bio;
> - bool is_readahead;
> struct bio *bio;
> - struct list_head *pages;
> + struct readahead_control *rac;
> };
>
> static void
> @@ -307,11 +306,11 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
> if (ctx->bio)
> submit_bio(ctx->bio);
>
> - if (ctx->is_readahead) /* same as readahead_gfp_mask */
> + if (ctx->rac) /* same as readahead_gfp_mask */
> gfp |= __GFP_NORETRY | __GFP_NOWARN;
> ctx->bio = bio_alloc(gfp, min(BIO_MAX_PAGES, nr_vecs));
> ctx->bio->bi_opf = REQ_OP_READ;
> - if (ctx->is_readahead)
> + if (ctx->rac)
> ctx->bio->bi_opf |= REQ_RAHEAD;
> ctx->bio->bi_iter.bi_sector = sector;
> bio_set_dev(ctx->bio, iomap->bdev);
> @@ -367,36 +366,8 @@ iomap_readpage(struct page *page, const struct iomap_ops *ops)
> }
> EXPORT_SYMBOL_GPL(iomap_readpage);
>
> -static struct page *
> -iomap_next_page(struct inode *inode, struct list_head *pages, loff_t pos,
> - loff_t length, loff_t *done)
> -{
> - while (!list_empty(pages)) {
> - struct page *page = lru_to_page(pages);
> -
> - if (page_offset(page) >= (u64)pos + length)
> - break;
> -
> - list_del(&page->lru);
> - if (!add_to_page_cache_lru(page, inode->i_mapping, page->index,
> - GFP_NOFS))
> - return page;
> -
> - /*
> - * If we already have a page in the page cache at index we are
> - * done. Upper layers don't care if it is uptodate after the
> - * readpages call itself as every page gets checked again once
> - * actually needed.
> - */
> - *done += PAGE_SIZE;
> - put_page(page);
> - }
> -
> - return NULL;
> -}
> -
> static loff_t
> -iomap_readpages_actor(struct inode *inode, loff_t pos, loff_t length,
> +iomap_readahead_actor(struct inode *inode, loff_t pos, loff_t length,
> void *data, struct iomap *iomap, struct iomap *srcmap)
> {
> struct iomap_readpage_ctx *ctx = data;
> @@ -404,10 +375,7 @@ iomap_readpages_actor(struct inode *inode, loff_t pos, loff_t length,
>
> while (done < length) {
> if (!ctx->cur_page) {
> - ctx->cur_page = iomap_next_page(inode, ctx->pages,
> - pos, length, &done);
> - if (!ctx->cur_page)
> - break;
> + ctx->cur_page = readahead_page(ctx->rac);
> ctx->cur_page_in_bio = false;
> }
> ret = iomap_readpage_actor(inode, pos + done, length - done,
> @@ -431,44 +399,48 @@ iomap_readpages_actor(struct inode *inode, loff_t pos, loff_t length,
> return done;
> }
>
> -int
> -iomap_readpages(struct address_space *mapping, struct list_head *pages,
> - unsigned nr_pages, const struct iomap_ops *ops)
> +/**
> + * iomap_readahead - Attempt to read pages from a file.
> + * @rac: Describes the pages to be read.
> + * @ops: The operations vector for the filesystem.
> + *
> + * This function is for filesystems to call to implement their readahead
> + * address_space operation.
> + *
> + * Context: The file is pinned by the caller, and the pages to be read are
> + * all locked and have an elevated refcount. This function will unlock
> + * the pages (once I/O has completed on them, or I/O has been determined to
> + * not be necessary). It will also decrease the refcount once the pages
> + * have been submitted for I/O. After this point, the page may be removed
> + * from the page cache, and should not be referenced.
> + */
Isn't the context documentation something that belongs into the aop
documentation? I've never really seen the value of duplicating this
information in method instances, as it is just bound to be out of date
rather sooner than later.
^ permalink raw reply
* [Ocfs2-devel] [PATCH v7 22/24] iomap: Convert from readpages to readahead
From: Christoph Hellwig @ 2020-02-20 15:49 UTC (permalink / raw)
To: Matthew Wilcox
Cc: linux-fsdevel, linux-mm, linux-kernel, linux-btrfs, linux-erofs,
linux-ext4, linux-f2fs-devel, cluster-devel, ocfs2-devel,
linux-xfs
In-Reply-To: <20200219210103.32400-23-willy@infradead.org>
On Wed, Feb 19, 2020 at 01:01:01PM -0800, Matthew Wilcox wrote:
> From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
>
> Use the new readahead operation in iomap. Convert XFS and ZoneFS to
> use it.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
> fs/iomap/buffered-io.c | 90 +++++++++++++++---------------------------
> fs/iomap/trace.h | 2 +-
> fs/xfs/xfs_aops.c | 13 +++---
> fs/zonefs/super.c | 7 ++--
> include/linux/iomap.h | 3 +-
> 5 files changed, 41 insertions(+), 74 deletions(-)
>
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index 31899e6cb0f8..66cf453f4bb7 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -214,9 +214,8 @@ iomap_read_end_io(struct bio *bio)
> struct iomap_readpage_ctx {
> struct page *cur_page;
> bool cur_page_in_bio;
> - bool is_readahead;
> struct bio *bio;
> - struct list_head *pages;
> + struct readahead_control *rac;
> };
>
> static void
> @@ -307,11 +306,11 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
> if (ctx->bio)
> submit_bio(ctx->bio);
>
> - if (ctx->is_readahead) /* same as readahead_gfp_mask */
> + if (ctx->rac) /* same as readahead_gfp_mask */
> gfp |= __GFP_NORETRY | __GFP_NOWARN;
> ctx->bio = bio_alloc(gfp, min(BIO_MAX_PAGES, nr_vecs));
> ctx->bio->bi_opf = REQ_OP_READ;
> - if (ctx->is_readahead)
> + if (ctx->rac)
> ctx->bio->bi_opf |= REQ_RAHEAD;
> ctx->bio->bi_iter.bi_sector = sector;
> bio_set_dev(ctx->bio, iomap->bdev);
> @@ -367,36 +366,8 @@ iomap_readpage(struct page *page, const struct iomap_ops *ops)
> }
> EXPORT_SYMBOL_GPL(iomap_readpage);
>
> -static struct page *
> -iomap_next_page(struct inode *inode, struct list_head *pages, loff_t pos,
> - loff_t length, loff_t *done)
> -{
> - while (!list_empty(pages)) {
> - struct page *page = lru_to_page(pages);
> -
> - if (page_offset(page) >= (u64)pos + length)
> - break;
> -
> - list_del(&page->lru);
> - if (!add_to_page_cache_lru(page, inode->i_mapping, page->index,
> - GFP_NOFS))
> - return page;
> -
> - /*
> - * If we already have a page in the page cache at index we are
> - * done. Upper layers don't care if it is uptodate after the
> - * readpages call itself as every page gets checked again once
> - * actually needed.
> - */
> - *done += PAGE_SIZE;
> - put_page(page);
> - }
> -
> - return NULL;
> -}
> -
> static loff_t
> -iomap_readpages_actor(struct inode *inode, loff_t pos, loff_t length,
> +iomap_readahead_actor(struct inode *inode, loff_t pos, loff_t length,
> void *data, struct iomap *iomap, struct iomap *srcmap)
> {
> struct iomap_readpage_ctx *ctx = data;
> @@ -404,10 +375,7 @@ iomap_readpages_actor(struct inode *inode, loff_t pos, loff_t length,
>
> while (done < length) {
> if (!ctx->cur_page) {
> - ctx->cur_page = iomap_next_page(inode, ctx->pages,
> - pos, length, &done);
> - if (!ctx->cur_page)
> - break;
> + ctx->cur_page = readahead_page(ctx->rac);
> ctx->cur_page_in_bio = false;
> }
> ret = iomap_readpage_actor(inode, pos + done, length - done,
> @@ -431,44 +399,48 @@ iomap_readpages_actor(struct inode *inode, loff_t pos, loff_t length,
> return done;
> }
>
> -int
> -iomap_readpages(struct address_space *mapping, struct list_head *pages,
> - unsigned nr_pages, const struct iomap_ops *ops)
> +/**
> + * iomap_readahead - Attempt to read pages from a file.
> + * @rac: Describes the pages to be read.
> + * @ops: The operations vector for the filesystem.
> + *
> + * This function is for filesystems to call to implement their readahead
> + * address_space operation.
> + *
> + * Context: The file is pinned by the caller, and the pages to be read are
> + * all locked and have an elevated refcount. This function will unlock
> + * the pages (once I/O has completed on them, or I/O has been determined to
> + * not be necessary). It will also decrease the refcount once the pages
> + * have been submitted for I/O. After this point, the page may be removed
> + * from the page cache, and should not be referenced.
> + */
Isn't the context documentation something that belongs into the aop
documentation? I've never really seen the value of duplicating this
information in method instances, as it is just bound to be out of date
rather sooner than later.
^ permalink raw reply
* [Cluster-devel] [PATCH v7 22/24] iomap: Convert from readpages to readahead
From: Christoph Hellwig @ 2020-02-20 15:49 UTC (permalink / raw)
To: cluster-devel.redhat.com
In-Reply-To: <20200219210103.32400-23-willy@infradead.org>
On Wed, Feb 19, 2020 at 01:01:01PM -0800, Matthew Wilcox wrote:
> From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
>
> Use the new readahead operation in iomap. Convert XFS and ZoneFS to
> use it.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
> fs/iomap/buffered-io.c | 90 +++++++++++++++---------------------------
> fs/iomap/trace.h | 2 +-
> fs/xfs/xfs_aops.c | 13 +++---
> fs/zonefs/super.c | 7 ++--
> include/linux/iomap.h | 3 +-
> 5 files changed, 41 insertions(+), 74 deletions(-)
>
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index 31899e6cb0f8..66cf453f4bb7 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -214,9 +214,8 @@ iomap_read_end_io(struct bio *bio)
> struct iomap_readpage_ctx {
> struct page *cur_page;
> bool cur_page_in_bio;
> - bool is_readahead;
> struct bio *bio;
> - struct list_head *pages;
> + struct readahead_control *rac;
> };
>
> static void
> @@ -307,11 +306,11 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
> if (ctx->bio)
> submit_bio(ctx->bio);
>
> - if (ctx->is_readahead) /* same as readahead_gfp_mask */
> + if (ctx->rac) /* same as readahead_gfp_mask */
> gfp |= __GFP_NORETRY | __GFP_NOWARN;
> ctx->bio = bio_alloc(gfp, min(BIO_MAX_PAGES, nr_vecs));
> ctx->bio->bi_opf = REQ_OP_READ;
> - if (ctx->is_readahead)
> + if (ctx->rac)
> ctx->bio->bi_opf |= REQ_RAHEAD;
> ctx->bio->bi_iter.bi_sector = sector;
> bio_set_dev(ctx->bio, iomap->bdev);
> @@ -367,36 +366,8 @@ iomap_readpage(struct page *page, const struct iomap_ops *ops)
> }
> EXPORT_SYMBOL_GPL(iomap_readpage);
>
> -static struct page *
> -iomap_next_page(struct inode *inode, struct list_head *pages, loff_t pos,
> - loff_t length, loff_t *done)
> -{
> - while (!list_empty(pages)) {
> - struct page *page = lru_to_page(pages);
> -
> - if (page_offset(page) >= (u64)pos + length)
> - break;
> -
> - list_del(&page->lru);
> - if (!add_to_page_cache_lru(page, inode->i_mapping, page->index,
> - GFP_NOFS))
> - return page;
> -
> - /*
> - * If we already have a page in the page cache at index we are
> - * done. Upper layers don't care if it is uptodate after the
> - * readpages call itself as every page gets checked again once
> - * actually needed.
> - */
> - *done += PAGE_SIZE;
> - put_page(page);
> - }
> -
> - return NULL;
> -}
> -
> static loff_t
> -iomap_readpages_actor(struct inode *inode, loff_t pos, loff_t length,
> +iomap_readahead_actor(struct inode *inode, loff_t pos, loff_t length,
> void *data, struct iomap *iomap, struct iomap *srcmap)
> {
> struct iomap_readpage_ctx *ctx = data;
> @@ -404,10 +375,7 @@ iomap_readpages_actor(struct inode *inode, loff_t pos, loff_t length,
>
> while (done < length) {
> if (!ctx->cur_page) {
> - ctx->cur_page = iomap_next_page(inode, ctx->pages,
> - pos, length, &done);
> - if (!ctx->cur_page)
> - break;
> + ctx->cur_page = readahead_page(ctx->rac);
> ctx->cur_page_in_bio = false;
> }
> ret = iomap_readpage_actor(inode, pos + done, length - done,
> @@ -431,44 +399,48 @@ iomap_readpages_actor(struct inode *inode, loff_t pos, loff_t length,
> return done;
> }
>
> -int
> -iomap_readpages(struct address_space *mapping, struct list_head *pages,
> - unsigned nr_pages, const struct iomap_ops *ops)
> +/**
> + * iomap_readahead - Attempt to read pages from a file.
> + * @rac: Describes the pages to be read.
> + * @ops: The operations vector for the filesystem.
> + *
> + * This function is for filesystems to call to implement their readahead
> + * address_space operation.
> + *
> + * Context: The file is pinned by the caller, and the pages to be read are
> + * all locked and have an elevated refcount. This function will unlock
> + * the pages (once I/O has completed on them, or I/O has been determined to
> + * not be necessary). It will also decrease the refcount once the pages
> + * have been submitted for I/O. After this point, the page may be removed
> + * from the page cache, and should not be referenced.
> + */
Isn't the context documentation something that belongs into the aop
documentation? I've never really seen the value of duplicating this
information in method instances, as it is just bound to be out of date
rather sooner than later.
^ permalink raw reply
* Re: A problem with live migration of UEFI virtual machines
From: Dr. David Alan Gilbert @ 2020-02-20 15:47 UTC (permalink / raw)
To: wuchenye1995; +Cc: devel@edk2.groups.io, edk2-devel, zhoujianjay, qemu-devel
In-Reply-To: <tencent_3CD8845EC159F0161725898B@qq.com>
* wuchenye1995 (wuchenye1995@gmail.com) wrote:
> We found a problem with live migration of UEFI virtual machines due to size of OVMF.fd changes.</div><div class=" selfdiv" style="height: 79.6875px; width: auto !important;"
> Specifically, the size of OVMF.fd in edk with low version such as edk-2.0-25 is <b>2MB</b> while the size of it in higher version such as edk-2.0-30 is <b>4MB</b>.
> When we migrate a UEFI virtual machine from the host with low version of edk2 to the host with higher one, qemu component will report an error in function
> qemu_ram_resize while
>checking size of ovmf_pcbios: Length mismatch: pc.bios: 0x200000 in != 0x400000: Invalid argument.
>We want to know how to solve this problem after updating the version of edk2.
When you migrate, you must migrate between identical configurations; so
you need ROM images (including edk2) that are the same size.
There's two answers;
a) Stick with the same version of the ROM between VMs you want to
migrate
b) Pad your ROM images to some larger size (e.g. 8MB) so that
even if they grow a little bigger then you don't hit the problem.
Dave
P.S. Please use plain text email
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply
* Re: [dpdk-dev] [PATCH v2] examples/fips_validation: fix incorrect string for CT length
From: David Marchand @ 2020-02-20 15:48 UTC (permalink / raw)
To: Anoob Joseph
Cc: Marko Kovacevic, Fan Zhang, Narayana Prasad, Akhil Goyal,
dev@dpdk.org
In-Reply-To: <VE1PR04MB6639BCF806B4FB4559B5C894E6130@VE1PR04MB6639.eurprd04.prod.outlook.com>
On Thu, Feb 20, 2020 at 11:15 AM Akhil Goyal <akhil.goyal@nxp.com> wrote:
> > The NIST test vectors use the string 'PTlen' to denote text lengths
> > in case of encrypt & decrypt operations. So the same string need to be
> > used while parsing PT and CT.
> >
> > Fixes: 2adb3b4e7e54 ("examples/fips_validation: fix AES-GCM cipher length
> > parsing")
> >
> > Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> > ---
> >
> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Applied, thanks.
--
David Marchand
^ permalink raw reply
* Re: [dpdk-dev] [PATCH] net/mlx5: fix metadata split with encap action
From: Raslan Darawsheh @ 2020-02-20 15:48 UTC (permalink / raw)
To: Matan Azrad, dev@dpdk.org; +Cc: Slava Ovsiienko, stable@dpdk.org
In-Reply-To: <1582209810-20546-1-git-send-email-matan@mellanox.com>
Hi,
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Matan Azrad
> Sent: Thursday, February 20, 2020 4:44 PM
> To: dev@dpdk.org
> Cc: Slava Ovsiienko <viacheslavo@mellanox.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix metadata split with encap action
>
> In order to move the mbuf metadata from the WQE to the FDB steering
> domain, the PMD add for each NIC TX flow a new action to copy the
> metadata register REG_A to REG_C_0.
>
> This copy action is considered as modify header action from HW
> perspective.
>
> The HW doesn't support to do modify header action after ant
> encapsulation action.
>
> The split metadata function wrongly added the copy action in the end of
> the original actions list, hence, NIC egress flow with encapapsulation
> action failed when the PMD worked with dv_xmeta_en mode.
>
> Move the copy action to be before and back to back with the
> encapsulation action for the aforementioned case.
>
> Fixes: 71e254bc0294 ("net/mlx5: split Rx flows to provide metadata copy")
> Cc: stable@dpdk.org
>
> Signed-off-by: Matan Azrad <matan@mellanox.com>
> ---
> drivers/net/mlx5/mlx5_flow.c | 66
> ++++++++++++++++++++++++++++++++++----------
> 1 file changed, 51 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
> index fa58546..60aab16 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -2744,7 +2744,7 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
> }
>
> /**
> - * Get QUEUE/RSS action from the action list.
> + * Get metadata split action information.
> *
> * @param[in] actions
> * Pointer to the list of actions.
> @@ -2753,18 +2753,38 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
> * @param[out] qrss_type
> * Pointer to the action type to return. RTE_FLOW_ACTION_TYPE_END is
> returned
> * if no QUEUE/RSS is found.
> + * @param[out] encap_idx
> + * Pointer to the index of the encap action if exists, otherwise the last
> + * action index.
> *
> * @return
> * Total number of actions.
> */
> static int
> -flow_parse_qrss_action(const struct rte_flow_action actions[],
> - const struct rte_flow_action **qrss)
> +flow_parse_metadata_split_actions_info(const struct rte_flow_action
> actions[],
> + const struct rte_flow_action **qrss,
> + int *encap_idx)
> {
> + const struct rte_flow_action_raw_encap *raw_encap;
> int actions_n = 0;
> + int raw_decap_idx = -1;
>
> + *encap_idx = -1;
> for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
> switch (actions->type) {
> + case RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP:
> + case RTE_FLOW_ACTION_TYPE_NVGRE_ENCAP:
> + *encap_idx = actions_n;
> + break;
> + case RTE_FLOW_ACTION_TYPE_RAW_DECAP:
> + raw_decap_idx = actions_n;
> + break;
> + case RTE_FLOW_ACTION_TYPE_RAW_ENCAP:
> + raw_encap = actions->conf;
> + if (raw_encap->size >
> MLX5_ENCAPSULATION_DECISION_SIZE)
> + *encap_idx = raw_decap_idx != -1 ?
> + raw_decap_idx :
> actions_n;
> + break;
> case RTE_FLOW_ACTION_TYPE_QUEUE:
> case RTE_FLOW_ACTION_TYPE_RSS:
> *qrss = actions;
> @@ -2774,6 +2794,8 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
> }
> actions_n++;
> }
> + if (*encap_idx == -1)
> + *encap_idx = actions_n;
> /* Count RTE_FLOW_ACTION_TYPE_END. */
> return actions_n + 1;
> }
> @@ -3739,6 +3761,8 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
> * Number of actions in the list.
> * @param[out] error
> * Perform verbose error reporting if not NULL.
> + * @param[in] encap_idx
> + * The encap action inndex.
> *
> * @return
> * 0 on success, negative value otherwise
> @@ -3747,7 +3771,8 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
> flow_mreg_tx_copy_prep(struct rte_eth_dev *dev,
> struct rte_flow_action *ext_actions,
> const struct rte_flow_action *actions,
> - int actions_n, struct rte_flow_error *error)
> + int actions_n, struct rte_flow_error *error,
> + int encap_idx)
> {
> struct mlx5_flow_action_copy_mreg *cp_mreg =
> (struct mlx5_flow_action_copy_mreg *)
> @@ -3762,15 +3787,24 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
> if (ret < 0)
> return ret;
> cp_mreg->src = ret;
> - memcpy(ext_actions, actions,
> - sizeof(*ext_actions) * actions_n);
> - ext_actions[actions_n - 1] = (struct rte_flow_action){
> - .type = MLX5_RTE_FLOW_ACTION_TYPE_COPY_MREG,
> - .conf = cp_mreg,
> - };
> - ext_actions[actions_n] = (struct rte_flow_action){
> - .type = RTE_FLOW_ACTION_TYPE_END,
> - };
> + if (encap_idx != 0)
> + memcpy(ext_actions, actions, sizeof(*ext_actions) *
> encap_idx);
> + if (encap_idx == actions_n - 1) {
> + ext_actions[actions_n - 1] = (struct rte_flow_action){
> + .type =
> MLX5_RTE_FLOW_ACTION_TYPE_COPY_MREG,
> + .conf = cp_mreg,
> + };
> + ext_actions[actions_n] = (struct rte_flow_action){
> + .type = RTE_FLOW_ACTION_TYPE_END,
> + };
> + } else {
> + ext_actions[encap_idx] = (struct rte_flow_action){
> + .type =
> MLX5_RTE_FLOW_ACTION_TYPE_COPY_MREG,
> + .conf = cp_mreg,
> + };
> + memcpy(ext_actions + encap_idx + 1, actions + encap_idx,
> + sizeof(*ext_actions) * (actions_n -
> encap_idx));
> + }
> return 0;
> }
>
> @@ -3821,6 +3855,7 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
> int mtr_sfx = 0;
> size_t act_size;
> int actions_n;
> + int encap_idx;
> int ret;
>
> /* Check whether extensive metadata feature is engaged. */
> @@ -3830,7 +3865,8 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
> return flow_create_split_inner(dev, flow, NULL,
> prefix_layers,
> attr, items, actions, external,
> error);
> - actions_n = flow_parse_qrss_action(actions, &qrss);
> + actions_n = flow_parse_metadata_split_actions_info(actions, &qrss,
> + &encap_idx);
> if (qrss) {
> /* Exclude hairpin flows from splitting. */
> if (qrss->type == RTE_FLOW_ACTION_TYPE_QUEUE) {
> @@ -3905,7 +3941,7 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
> "metadata flow");
> /* Create the action list appended with copy register. */
> ret = flow_mreg_tx_copy_prep(dev, ext_actions, actions,
> - actions_n, error);
> + actions_n, error, encap_idx);
> if (ret < 0)
> goto exit;
> }
> --
> 1.8.3.1
Fixed typo in commit log,
And patch applied to next-net-mlx,
Kindest regards
Raslan Darawsheh
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.